blob: 3112244bfd385c24d7ebeab75e412f86191bb541 [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 Guye9bc11f2013-05-23 12:47:26 -070020#include <cutils/compiler.h>
21
Romain Guy3bbacf22013-02-06 16:51:04 -080022#include <utils/Singleton.h>
Romain Guybd0e6aa2010-07-22 18:50:12 -070023#include <utils/SortedVector.h>
24#include <utils/String8.h>
25
Romain Guybd0e6aa2010-07-22 18:50:12 -070026namespace android {
27namespace uirenderer {
28
Romain Guya5aed0d2010-09-09 14:42:43 -070029///////////////////////////////////////////////////////////////////////////////
Romain Guya60c3882011-08-01 15:28:16 -070030// Classes
31///////////////////////////////////////////////////////////////////////////////
32
Romain Guye9bc11f2013-05-23 12:47:26 -070033class ANDROID_API Extensions: public Singleton<Extensions> {
Romain Guybd0e6aa2010-07-22 18:50:12 -070034public:
Romain Guybd0e6aa2010-07-22 18:50:12 -070035 inline bool hasNPot() const { return mHasNPot; }
Romain Guya5aed0d2010-09-09 14:42:43 -070036 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
Romain Guy9c4b79a2011-11-10 19:23:58 -080037 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
Romain Guy13631f32012-01-30 17:41:55 -080038 inline bool hasDebugMarker() const { return mHasDebugMarker; }
Romain Guydfa10462012-05-12 16:18:58 -070039 inline bool hasDebugLabel() const { return mHasDebugLabel; }
Romain Guy85ef80d2012-09-13 20:26:50 -070040 inline bool hasTiledRendering() const { return mHasTiledRendering; }
Romain Guy3bbacf22013-02-06 16:51:04 -080041 inline bool has1BitStencil() const { return mHas1BitStencil; }
42 inline bool has4BitStencil() const { return mHas4BitStencil; }
Romain Guye9bc11f2013-05-23 12:47:26 -070043 inline bool hasNvSystemTime() const { return mHasNvSystemTime; }
Romain Guybd0e6aa2010-07-22 18:50:12 -070044
Romain Guydf1dc282013-03-29 18:32:29 -070045 inline int getMajorGlVersion() const { return mVersionMajor; }
46 inline int getMinorGlVersion() const { return mVersionMinor; }
47
Romain Guye9bc11f2013-05-23 12:47:26 -070048 bool hasGlExtension(const char* extension) const;
49 bool hasEglExtension(const char* extension) const;
Romain Guybd0e6aa2010-07-22 18:50:12 -070050
Romain Guy3bbacf22013-02-06 16:51:04 -080051 void dump() const;
Romain Guy51769a62010-07-23 00:28:00 -070052
Romain Guybd0e6aa2010-07-22 18:50:12 -070053private:
Romain Guy3b748a42013-04-17 18:54:38 -070054 Extensions();
55 ~Extensions();
56
Romain Guye9bc11f2013-05-23 12:47:26 -070057 void findExtensions(const char* extensions, SortedVector<String8>& list) const;
58
Romain Guy3bbacf22013-02-06 16:51:04 -080059 friend class Singleton<Extensions>;
60
Romain Guye9bc11f2013-05-23 12:47:26 -070061 SortedVector<String8> mGlExtensionList;
62 SortedVector<String8> mEglExtensionList;
Romain Guy51769a62010-07-23 00:28:00 -070063
Romain Guybd0e6aa2010-07-22 18:50:12 -070064 bool mHasNPot;
Romain Guya5aed0d2010-09-09 14:42:43 -070065 bool mHasFramebufferFetch;
Romain Guy9c4b79a2011-11-10 19:23:58 -080066 bool mHasDiscardFramebuffer;
Romain Guy13631f32012-01-30 17:41:55 -080067 bool mHasDebugMarker;
Romain Guydfa10462012-05-12 16:18:58 -070068 bool mHasDebugLabel;
Romain Guy85ef80d2012-09-13 20:26:50 -070069 bool mHasTiledRendering;
Romain Guy3bbacf22013-02-06 16:51:04 -080070 bool mHas1BitStencil;
71 bool mHas4BitStencil;
Romain Guye9bc11f2013-05-23 12:47:26 -070072 bool mHasNvSystemTime;
Romain Guydf1dc282013-03-29 18:32:29 -070073
74 int mVersionMajor;
75 int mVersionMinor;
Romain Guybd0e6aa2010-07-22 18:50:12 -070076}; // class Extensions
77
78}; // namespace uirenderer
79}; // namespace android
80
Romain Guy5b3b3522010-10-27 18:57:51 -070081#endif // ANDROID_HWUI_EXTENSIONS_H