blob: 6689b88f17e349b6f05ed7f51f897bf0608bd743 [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 Guybd0e6aa2010-07-22 18:50:12 -070022namespace android {
23namespace uirenderer {
24
Romain Guya5aed0d2010-09-09 14:42:43 -070025///////////////////////////////////////////////////////////////////////////////
Romain Guya60c3882011-08-01 15:28:16 -070026// Classes
27///////////////////////////////////////////////////////////////////////////////
28
Chris Craik117bdbc2015-02-05 10:12:38 -080029class ANDROID_API Extensions {
Romain Guybd0e6aa2010-07-22 18:50:12 -070030public:
Chris Craik117bdbc2015-02-05 10:12:38 -080031 Extensions();
32
Romain Guybd0e6aa2010-07-22 18:50:12 -070033 inline bool hasNPot() const { return mHasNPot; }
Romain Guya5aed0d2010-09-09 14:42:43 -070034 inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
Romain Guy9c4b79a2011-11-10 19:23:58 -080035 inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
Romain Guy13631f32012-01-30 17:41:55 -080036 inline bool hasDebugMarker() const { return mHasDebugMarker; }
Romain Guy3bbacf22013-02-06 16:51:04 -080037 inline bool has1BitStencil() const { return mHas1BitStencil; }
38 inline bool has4BitStencil() const { return mHas4BitStencil; }
xiaozhengdongd538d302015-08-04 16:55:35 +080039 inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; }
Romain Guy7f430762013-06-13 14:29:40 -070040 inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; }
41 inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; }
42 inline bool hasFloatTextures() const { return mVersionMajor >= 3; }
43
Romain Guydf1dc282013-03-29 18:32:29 -070044 inline int getMajorGlVersion() const { return mVersionMajor; }
45 inline int getMinorGlVersion() const { return mVersionMinor; }
46
Romain Guybd0e6aa2010-07-22 18:50:12 -070047private:
Romain Guybd0e6aa2010-07-22 18:50:12 -070048 bool mHasNPot;
Romain Guya5aed0d2010-09-09 14:42:43 -070049 bool mHasFramebufferFetch;
Romain Guy9c4b79a2011-11-10 19:23:58 -080050 bool mHasDiscardFramebuffer;
Romain Guy13631f32012-01-30 17:41:55 -080051 bool mHasDebugMarker;
Romain Guy3bbacf22013-02-06 16:51:04 -080052 bool mHas1BitStencil;
53 bool mHas4BitStencil;
xiaozhengdongd538d302015-08-04 16:55:35 +080054 bool mHasUnpackSubImage;
Romain Guydf1dc282013-03-29 18:32:29 -070055
56 int mVersionMajor;
57 int mVersionMinor;
Romain Guybd0e6aa2010-07-22 18:50:12 -070058}; // class Extensions
59
60}; // namespace uirenderer
61}; // namespace android
62
Romain Guy5b3b3522010-10-27 18:57:51 -070063#endif // ANDROID_HWUI_EXTENSIONS_H