Extensions.h revision 3bbacf27c0be1bae4e4483577fc89ae3113abe5d
1bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy/* 2bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * Copyright (C) 2010 The Android Open Source Project 3bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * 4bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * Licensed under the Apache License, Version 2.0 (the "License"); 5bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * you may not use this file except in compliance with the License. 6bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * You may obtain a copy of the License at 7bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * 8bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * http://www.apache.org/licenses/LICENSE-2.0 9bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * 10bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * Unless required by applicable law or agreed to in writing, software 11bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * distributed under the License is distributed on an "AS IS" BASIS, 12bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * See the License for the specific language governing permissions and 14bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy * limitations under the License. 15bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy */ 16bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 175b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#ifndef ANDROID_HWUI_EXTENSIONS_H 185b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#define ANDROID_HWUI_EXTENSIONS_H 19bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 203bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy#include <utils/Singleton.h> 21bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy#include <utils/SortedVector.h> 22bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy#include <utils/String8.h> 23bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 24bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy#include <GLES2/gl2.h> 25bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy#include <GLES2/gl2ext.h> 26bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 27bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guynamespace android { 28bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guynamespace uirenderer { 29bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 30a5aed0d58962a24c44728ffc46dc9e1ba2f9fda5Romain Guy/////////////////////////////////////////////////////////////////////////////// 31a60c3889718f4513a6c9d8b80f655db5d6346905Romain Guy// Classes 32a60c3889718f4513a6c9d8b80f655db5d6346905Romain Guy/////////////////////////////////////////////////////////////////////////////// 33a60c3889718f4513a6c9d8b80f655db5d6346905Romain Guy 343bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guyclass Extensions: public Singleton<Extensions> { 35bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guypublic: 363bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy Extensions(); 373bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy ~Extensions(); 38bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 39bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy inline bool hasNPot() const { return mHasNPot; } 40a5aed0d58962a24c44728ffc46dc9e1ba2f9fda5Romain Guy inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } 419c4b79af221b53f602f946faa9ff317a596a0c39Romain Guy inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } 4213631f3da855f200a151e7837ed9f6b079622b58Romain Guy inline bool hasDebugMarker() const { return mHasDebugMarker; } 43dfa1046ecab165eb0daf5caa8475e993350f4a2bRomain Guy inline bool hasDebugLabel() const { return mHasDebugLabel; } 4485ef80d8902afe8d26cb75fa7837fd9e6d019620Romain Guy inline bool hasTiledRendering() const { return mHasTiledRendering; } 453bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy inline bool has1BitStencil() const { return mHas1BitStencil; } 463bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy inline bool has4BitStencil() const { return mHas4BitStencil; } 47bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 483bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy bool hasExtension(const char* extension) const; 49bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 503bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy void dump() const; 5151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy 52bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guyprivate: 533bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy friend class Singleton<Extensions>; 543bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy 55bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy SortedVector<String8> mExtensionList; 56bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 5785ef80d8902afe8d26cb75fa7837fd9e6d019620Romain Guy char* mExtensions; 5851769a68a5cb34e9564740c6a854fcb93018789dRomain Guy 59bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy bool mHasNPot; 60a5aed0d58962a24c44728ffc46dc9e1ba2f9fda5Romain Guy bool mHasFramebufferFetch; 619c4b79af221b53f602f946faa9ff317a596a0c39Romain Guy bool mHasDiscardFramebuffer; 6213631f3da855f200a151e7837ed9f6b079622b58Romain Guy bool mHasDebugMarker; 63dfa1046ecab165eb0daf5caa8475e993350f4a2bRomain Guy bool mHasDebugLabel; 6485ef80d8902afe8d26cb75fa7837fd9e6d019620Romain Guy bool mHasTiledRendering; 653bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy bool mHas1BitStencil; 663bbacf27c0be1bae4e4483577fc89ae3113abe5dRomain Guy bool mHas4BitStencil; 67bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy}; // class Extensions 68bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 69bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy}; // namespace uirenderer 70bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy}; // namespace android 71bd0e6aa0ff0bd8b376772c3e23513a6021bdda87Romain Guy 725b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#endif // ANDROID_HWUI_EXTENSIONS_H 73