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 | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 20 | #include <utils/Singleton.h> |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 21 | #include <utils/SortedVector.h> |
| 22 | #include <utils/String8.h> |
| 23 | |
| 24 | #include <GLES2/gl2.h> |
| 25 | #include <GLES2/gl2ext.h> |
| 26 | |
| 27 | namespace android { |
| 28 | namespace uirenderer { |
| 29 | |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 30 | /////////////////////////////////////////////////////////////////////////////// |
Romain Guy | a60c388 | 2011-08-01 15:28:16 -0700 | [diff] [blame] | 31 | // Classes |
| 32 | /////////////////////////////////////////////////////////////////////////////// |
| 33 | |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 34 | class Extensions: public Singleton<Extensions> { |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 35 | public: |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 36 | Extensions(); |
| 37 | ~Extensions(); |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 38 | |
| 39 | inline bool hasNPot() const { return mHasNPot; } |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 40 | inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } |
Romain Guy | 9c4b79a | 2011-11-10 19:23:58 -0800 | [diff] [blame] | 41 | inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 42 | inline bool hasDebugMarker() const { return mHasDebugMarker; } |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 43 | inline bool hasDebugLabel() const { return mHasDebugLabel; } |
Romain Guy | 85ef80d | 2012-09-13 20:26:50 -0700 | [diff] [blame] | 44 | inline bool hasTiledRendering() const { return mHasTiledRendering; } |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 45 | inline bool has1BitStencil() const { return mHas1BitStencil; } |
| 46 | inline bool has4BitStencil() const { return mHas4BitStencil; } |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 47 | |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 48 | bool hasExtension(const char* extension) const; |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 49 | |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 50 | void dump() const; |
Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 51 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 52 | private: |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 53 | friend class Singleton<Extensions>; |
| 54 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 55 | SortedVector<String8> mExtensionList; |
| 56 | |
Romain Guy | 85ef80d | 2012-09-13 20:26:50 -0700 | [diff] [blame] | 57 | char* mExtensions; |
Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 58 | |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 59 | bool mHasNPot; |
Romain Guy | a5aed0d | 2010-09-09 14:42:43 -0700 | [diff] [blame] | 60 | bool mHasFramebufferFetch; |
Romain Guy | 9c4b79a | 2011-11-10 19:23:58 -0800 | [diff] [blame] | 61 | bool mHasDiscardFramebuffer; |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 62 | bool mHasDebugMarker; |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 63 | bool mHasDebugLabel; |
Romain Guy | 85ef80d | 2012-09-13 20:26:50 -0700 | [diff] [blame] | 64 | bool mHasTiledRendering; |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 65 | bool mHas1BitStencil; |
| 66 | bool mHas4BitStencil; |
Romain Guy | bd0e6aa | 2010-07-22 18:50:12 -0700 | [diff] [blame] | 67 | }; // class Extensions |
| 68 | |
| 69 | }; // namespace uirenderer |
| 70 | }; // namespace android |
| 71 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 72 | #endif // ANDROID_HWUI_EXTENSIONS_H |