Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 1 | /* |
| 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 Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 17 | #ifndef ANDROID_HWUI_EXTENSIONS_H |
| 18 | #define ANDROID_HWUI_EXTENSIONS_H |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 19 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 20 | namespace android { |
| 21 | namespace uirenderer { |
| 22 | |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 23 | /////////////////////////////////////////////////////////////////////////////// |
Romain Guy | a60c388 | 2011-08-01 15:28:16 -0700 | [diff] [blame] | 24 | // Classes |
| 25 | /////////////////////////////////////////////////////////////////////////////// |
| 26 | |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 27 | class Extensions { |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 28 | public: |
John Reck | 1540153 | 2015-11-16 10:40:31 -0800 | [diff] [blame] | 29 | Extensions(); |
Chris Craik | 117bdbc | 2015-02-05 10:12:38 -0800 | [diff] [blame] | 30 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 31 | inline bool hasNPot() const { return mHasNPot; } |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 32 | inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } |
Romain Guy | 9c4b79a | 2011-11-10 19:23:58 -0800 | [diff] [blame] | 33 | inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 34 | inline bool hasDebugMarker() const { return mHasDebugMarker; } |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 35 | inline bool has1BitStencil() const { return mHas1BitStencil; } |
| 36 | inline bool has4BitStencil() const { return mHas4BitStencil; } |
xiaozhengdong | d538d30 | 2015-08-04 16:55:35 +0800 | [diff] [blame] | 37 | inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; } |
Romain Guy | 7f43076 | 2013-06-13 14:29:40 -0700 | [diff] [blame] | 38 | inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; } |
| 39 | inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; } |
| 40 | inline bool hasFloatTextures() const { return mVersionMajor >= 3; } |
Romain Guy | 8472ac6 | 2017-11-01 09:50:28 -0700 | [diff] [blame] | 41 | inline bool hasRenderableFloatTextures() const { |
| 42 | return (mVersionMajor >= 3 && mVersionMinor >= 2) || mHasRenderableFloatTexture; |
| 43 | } |
Romain Guy | 8762e33 | 2016-10-12 12:14:07 -0700 | [diff] [blame] | 44 | inline bool hasSRGB() const { return mHasSRGB; } |
Romain Guy | 253f2c2 | 2016-09-28 17:34:42 -0700 | [diff] [blame] | 45 | inline bool hasSRGBWriteControl() const { return hasSRGB() && mHasSRGBWriteControl; } |
Romain Guy | efb4b06 | 2017-02-27 11:00:04 -0800 | [diff] [blame] | 46 | inline bool hasLinearBlending() const { return hasSRGB() && mHasLinearBlending; } |
Romain Guy | 7f43076 | 2013-06-13 14:29:40 -0700 | [diff] [blame] | 47 | |
Romain Guy | df1dc28 | 2013-03-29 18:32:29 -0700 | [diff] [blame] | 48 | inline int getMajorGlVersion() const { return mVersionMajor; } |
| 49 | inline int getMinorGlVersion() const { return mVersionMinor; } |
| 50 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 51 | private: |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 52 | bool mHasNPot; |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 53 | bool mHasFramebufferFetch; |
Romain Guy | 9c4b79a | 2011-11-10 19:23:58 -0800 | [diff] [blame] | 54 | bool mHasDiscardFramebuffer; |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 55 | bool mHasDebugMarker; |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 56 | bool mHas1BitStencil; |
| 57 | bool mHas4BitStencil; |
xiaozhengdong | d538d30 | 2015-08-04 16:55:35 +0800 | [diff] [blame] | 58 | bool mHasUnpackSubImage; |
Romain Guy | 253f2c2 | 2016-09-28 17:34:42 -0700 | [diff] [blame] | 59 | bool mHasSRGB; |
| 60 | bool mHasSRGBWriteControl; |
Romain Guy | efb4b06 | 2017-02-27 11:00:04 -0800 | [diff] [blame] | 61 | bool mHasLinearBlending; |
Romain Guy | 8472ac6 | 2017-11-01 09:50:28 -0700 | [diff] [blame] | 62 | bool mHasRenderableFloatTexture; |
Romain Guy | df1dc28 | 2013-03-29 18:32:29 -0700 | [diff] [blame] | 63 | |
| 64 | int mVersionMajor; |
| 65 | int mVersionMinor; |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 66 | }; // class Extensions |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 67 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 68 | }; // namespace uirenderer |
| 69 | }; // namespace android |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 70 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 71 | #endif // ANDROID_HWUI_EXTENSIONS_H |