blob: 214ee0bbeefd809c573b96fa797f72b44a0351fd [file] [log] [blame]
Romain Guybd0e6aa2010-07-22 18:50:12 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Romain Guy5b3b3522010-10-27 18:57:51 -070017#ifndef ANDROID_HWUI_EXTENSIONS_H
18#define ANDROID_HWUI_EXTENSIONS_H
Romain Guybd0e6aa2010-07-22 18:50:12 -070019
Romain Guybd0e6aa2010-07-22 18:50:12 -070020namespace android {
21namespace uirenderer {
22
Romain Guya5aed0d2010-09-09 14:42:43 -070023///////////////////////////////////////////////////////////////////////////////
Romain Guya60c3882011-08-01 15:28:16 -070024// Classes
25///////////////////////////////////////////////////////////////////////////////
26
John Reck704bed02015-11-05 09:22:17 -080027class Extensions {
Romain Guybd0e6aa2010-07-22 18:50:12 -070028public:
John Reck15401532015-11-16 10:40:31 -080029 Extensions();
Chris Craik117bdbc2015-02-05 10:12:38 -080030
Romain Guybd0e6aa2010-07-22 18:50:12 -070031 inline bool hasNPot() const { return mHasNPot; }
Romain Guya5aed0d2010-09-09 14:42:43 -070032 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
Romain Guy9c4b79a2011-11-10 19:23:58 -080033 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
Romain Guy13631f32012-01-30 17:41:55 -080034 inline bool hasDebugMarker() const { return mHasDebugMarker; }
Romain Guy3bbacf22013-02-06 16:51:04 -080035 inline bool has1BitStencil() const { return mHas1BitStencil; }
36 inline bool has4BitStencil() const { return mHas4BitStencil; }
xiaozhengdongd538d302015-08-04 16:55:35 +080037 inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; }
Romain Guy7f430762013-06-13 14:29:40 -070038 inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; }
39 inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; }
40 inline bool hasFloatTextures() const { return mVersionMajor >= 3; }
Romain Guy8472ac62017-11-01 09:50:28 -070041 inline bool hasRenderableFloatTextures() const {
42 return (mVersionMajor >= 3 && mVersionMinor >= 2) || mHasRenderableFloatTexture;
43 }
Romain Guy8762e332016-10-12 12:14:07 -070044 inline bool hasSRGB() const { return mHasSRGB; }
Romain Guy253f2c22016-09-28 17:34:42 -070045 inline bool hasSRGBWriteControl() const { return hasSRGB() && mHasSRGBWriteControl; }
Romain Guyefb4b062017-02-27 11:00:04 -080046 inline bool hasLinearBlending() const { return hasSRGB() && mHasLinearBlending; }
Romain Guy7f430762013-06-13 14:29:40 -070047
Romain Guydf1dc282013-03-29 18:32:29 -070048 inline int getMajorGlVersion() const { return mVersionMajor; }
49 inline int getMinorGlVersion() const { return mVersionMinor; }
50
Romain Guybd0e6aa2010-07-22 18:50:12 -070051private:
Romain Guybd0e6aa2010-07-22 18:50:12 -070052 bool mHasNPot;
Romain Guya5aed0d2010-09-09 14:42:43 -070053 bool mHasFramebufferFetch;
Romain Guy9c4b79a2011-11-10 19:23:58 -080054 bool mHasDiscardFramebuffer;
Romain Guy13631f32012-01-30 17:41:55 -080055 bool mHasDebugMarker;
Romain Guy3bbacf22013-02-06 16:51:04 -080056 bool mHas1BitStencil;
57 bool mHas4BitStencil;
xiaozhengdongd538d302015-08-04 16:55:35 +080058 bool mHasUnpackSubImage;
Romain Guy253f2c22016-09-28 17:34:42 -070059 bool mHasSRGB;
60 bool mHasSRGBWriteControl;
Romain Guyefb4b062017-02-27 11:00:04 -080061 bool mHasLinearBlending;
Romain Guy8472ac62017-11-01 09:50:28 -070062 bool mHasRenderableFloatTexture;
Romain Guydf1dc282013-03-29 18:32:29 -070063
64 int mVersionMajor;
65 int mVersionMinor;
John Reck1bcacfd2017-11-03 10:12:19 -070066}; // class Extensions
Romain Guybd0e6aa2010-07-22 18:50:12 -070067
John Reck1bcacfd2017-11-03 10:12:19 -070068}; // namespace uirenderer
69}; // namespace android
Romain Guybd0e6aa2010-07-22 18:50:12 -070070
John Reck1bcacfd2017-11-03 10:12:19 -070071#endif // ANDROID_HWUI_EXTENSIONS_H