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 17 #ifndef ANDROID_HWUI_EXTENSIONS_H 18 #define ANDROID_HWUI_EXTENSIONS_H 19 20 namespace android { 21 namespace uirenderer { 22 23 /////////////////////////////////////////////////////////////////////////////// 24 // Classes 25 /////////////////////////////////////////////////////////////////////////////// 26 27 class Extensions { 28 public: 29 Extensions(); 30 hasNPot()31 inline bool hasNPot() const { return mHasNPot; } hasFramebufferFetch()32 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } hasDiscardFramebuffer()33 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } hasDebugMarker()34 inline bool hasDebugMarker() const { return mHasDebugMarker; } has1BitStencil()35 inline bool has1BitStencil() const { return mHas1BitStencil; } has4BitStencil()36 inline bool has4BitStencil() const { return mHas4BitStencil; } hasUnpackRowLength()37 inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; } hasPixelBufferObjects()38 inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; } hasOcclusionQueries()39 inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; } hasFloatTextures()40 inline bool hasFloatTextures() const { return mVersionMajor >= 3; } hasSRGB()41 inline bool hasSRGB() const { return mHasSRGB; } hasSRGBWriteControl()42 inline bool hasSRGBWriteControl() const { return hasSRGB() && mHasSRGBWriteControl; } hasLinearBlending()43 inline bool hasLinearBlending() const { return hasSRGB() && mHasLinearBlending; } 44 getMajorGlVersion()45 inline int getMajorGlVersion() const { return mVersionMajor; } getMinorGlVersion()46 inline int getMinorGlVersion() const { return mVersionMinor; } 47 48 private: 49 bool mHasNPot; 50 bool mHasFramebufferFetch; 51 bool mHasDiscardFramebuffer; 52 bool mHasDebugMarker; 53 bool mHas1BitStencil; 54 bool mHas4BitStencil; 55 bool mHasUnpackSubImage; 56 bool mHasSRGB; 57 bool mHasSRGBWriteControl; 58 bool mHasLinearBlending; 59 60 int mVersionMajor; 61 int mVersionMinor; 62 }; // class Extensions 63 64 }; // namespace uirenderer 65 }; // namespace android 66 67 #endif // ANDROID_HWUI_EXTENSIONS_H 68