Extensions.h revision 3bbacf27c0be1bae4e4483577fc89ae3113abe5d
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#include <utils/Singleton.h> 21#include <utils/SortedVector.h> 22#include <utils/String8.h> 23 24#include <GLES2/gl2.h> 25#include <GLES2/gl2ext.h> 26 27namespace android { 28namespace uirenderer { 29 30/////////////////////////////////////////////////////////////////////////////// 31// Classes 32/////////////////////////////////////////////////////////////////////////////// 33 34class Extensions: public Singleton<Extensions> { 35public: 36 Extensions(); 37 ~Extensions(); 38 39 inline bool hasNPot() const { return mHasNPot; } 40 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } 41 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } 42 inline bool hasDebugMarker() const { return mHasDebugMarker; } 43 inline bool hasDebugLabel() const { return mHasDebugLabel; } 44 inline bool hasTiledRendering() const { return mHasTiledRendering; } 45 inline bool has1BitStencil() const { return mHas1BitStencil; } 46 inline bool has4BitStencil() const { return mHas4BitStencil; } 47 48 bool hasExtension(const char* extension) const; 49 50 void dump() const; 51 52private: 53 friend class Singleton<Extensions>; 54 55 SortedVector<String8> mExtensionList; 56 57 char* mExtensions; 58 59 bool mHasNPot; 60 bool mHasFramebufferFetch; 61 bool mHasDiscardFramebuffer; 62 bool mHasDebugMarker; 63 bool mHasDebugLabel; 64 bool mHasTiledRendering; 65 bool mHas1BitStencil; 66 bool mHas4BitStencil; 67}; // class Extensions 68 69}; // namespace uirenderer 70}; // namespace android 71 72#endif // ANDROID_HWUI_EXTENSIONS_H 73