blob: 54a3987afde4c5702f2e91a3c17f5ad7e732e82c [file] [log] [blame]
Romain Guybd0e6aa2010-07-22 18:50:12 -07001/*
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 Guy5b3b3522010-10-27 18:57:51 -070017#ifndef ANDROID_HWUI_EXTENSIONS_H
18#define ANDROID_HWUI_EXTENSIONS_H
Romain Guybd0e6aa2010-07-22 18:50:12 -070019
Romain Guy3bbacf22013-02-06 16:51:04 -080020#include <utils/Singleton.h>
Romain Guybd0e6aa2010-07-22 18:50:12 -070021#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
Romain Guya5aed0d2010-09-09 14:42:43 -070030///////////////////////////////////////////////////////////////////////////////
Romain Guya60c3882011-08-01 15:28:16 -070031// Classes
32///////////////////////////////////////////////////////////////////////////////
33
Romain Guy3bbacf22013-02-06 16:51:04 -080034class Extensions: public Singleton<Extensions> {
Romain Guybd0e6aa2010-07-22 18:50:12 -070035public:
Romain Guy3bbacf22013-02-06 16:51:04 -080036 Extensions();
37 ~Extensions();
Romain Guybd0e6aa2010-07-22 18:50:12 -070038
39 inline bool hasNPot() const { return mHasNPot; }
Romain Guya5aed0d2010-09-09 14:42:43 -070040 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
Romain Guy9c4b79a2011-11-10 19:23:58 -080041 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
Romain Guy13631f32012-01-30 17:41:55 -080042 inline bool hasDebugMarker() const { return mHasDebugMarker; }
Romain Guydfa10462012-05-12 16:18:58 -070043 inline bool hasDebugLabel() const { return mHasDebugLabel; }
Romain Guy85ef80d2012-09-13 20:26:50 -070044 inline bool hasTiledRendering() const { return mHasTiledRendering; }
Romain Guy3bbacf22013-02-06 16:51:04 -080045 inline bool has1BitStencil() const { return mHas1BitStencil; }
46 inline bool has4BitStencil() const { return mHas4BitStencil; }
Romain Guybd0e6aa2010-07-22 18:50:12 -070047
Romain Guydf1dc282013-03-29 18:32:29 -070048 inline int getMajorGlVersion() const { return mVersionMajor; }
49 inline int getMinorGlVersion() const { return mVersionMinor; }
50
Romain Guy3bbacf22013-02-06 16:51:04 -080051 bool hasExtension(const char* extension) const;
Romain Guybd0e6aa2010-07-22 18:50:12 -070052
Romain Guy3bbacf22013-02-06 16:51:04 -080053 void dump() const;
Romain Guy51769a62010-07-23 00:28:00 -070054
Romain Guybd0e6aa2010-07-22 18:50:12 -070055private:
Romain Guy3bbacf22013-02-06 16:51:04 -080056 friend class Singleton<Extensions>;
57
Romain Guybd0e6aa2010-07-22 18:50:12 -070058 SortedVector<String8> mExtensionList;
59
Romain Guy85ef80d2012-09-13 20:26:50 -070060 char* mExtensions;
Romain Guydf1dc282013-03-29 18:32:29 -070061 char* mVersion;
Romain Guy51769a62010-07-23 00:28:00 -070062
Romain Guybd0e6aa2010-07-22 18:50:12 -070063 bool mHasNPot;
Romain Guya5aed0d2010-09-09 14:42:43 -070064 bool mHasFramebufferFetch;
Romain Guy9c4b79a2011-11-10 19:23:58 -080065 bool mHasDiscardFramebuffer;
Romain Guy13631f32012-01-30 17:41:55 -080066 bool mHasDebugMarker;
Romain Guydfa10462012-05-12 16:18:58 -070067 bool mHasDebugLabel;
Romain Guy85ef80d2012-09-13 20:26:50 -070068 bool mHasTiledRendering;
Romain Guy3bbacf22013-02-06 16:51:04 -080069 bool mHas1BitStencil;
70 bool mHas4BitStencil;
Romain Guydf1dc282013-03-29 18:32:29 -070071
72 int mVersionMajor;
73 int mVersionMinor;
Romain Guybd0e6aa2010-07-22 18:50:12 -070074}; // class Extensions
75
76}; // namespace uirenderer
77}; // namespace android
78
Romain Guy5b3b3522010-10-27 18:57:51 -070079#endif // ANDROID_HWUI_EXTENSIONS_H