summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Extensions.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-08-01 15:28:16 -0700
committerRomain Guy <romainguy@google.com>2011-08-01 15:28:16 -0700
commita60c3889718f4513a6c9d8b80f655db5d6346905 (patch)
treee0a43ec5fbc9031aa839ccb5be2064cfd85181fc /libs/hwui/Extensions.h
parente5ea4403ce58982522554b7ff23f41e6551923c1 (diff)
downloadframeworks_base-a60c3889718f4513a6c9d8b80f655db5d6346905.zip
frameworks_base-a60c3889718f4513a6c9d8b80f655db5d6346905.tar.gz
frameworks_base-a60c3889718f4513a6c9d8b80f655db5d6346905.tar.bz2
Use high precision iterators on specific GPUs
Bug #5098359 Change-Id: I52ee8c7b4c9e8d4c7bedb684eaf7bef6c44c74b9
Diffstat (limited to 'libs/hwui/Extensions.h')
-rw-r--r--libs/hwui/Extensions.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index eceb5c1..38d1130 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -23,6 +23,8 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include "Debug.h"
+
namespace android {
namespace uirenderer {
@@ -31,15 +33,20 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
// Debug
-#define DEBUG_EXTENSIONS 0
-
-// Debug
#if DEBUG_EXTENSIONS
#define EXT_LOGD(...) LOGD(__VA_ARGS__)
#else
#define EXT_LOGD(...)
#endif
+// Vendor strings
+
+#define VENDOR_IMG "Imagination Technologies"
+
+///////////////////////////////////////////////////////////////////////////////
+// Classes
+///////////////////////////////////////////////////////////////////////////////
+
class Extensions {
public:
Extensions() {
@@ -58,17 +65,21 @@ public:
} while (head);
mHasNPot = hasExtension("GL_OES_texture_npot");
- mHasDrawPath = hasExtension("GL_NV_draw_path");
- mHasCoverageSample = hasExtension("GL_NV_coverage_sample");
mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch");
+ const char* vendor = (const char*) glGetString(GL_VENDOR);
+ EXT_LOGD("Vendor: %s", vendor);
+ mNeedsHighpTexCoords = strcmp(vendor, VENDOR_IMG) == 0;
+
+ // We don't need to copy the string, the OpenGL ES spec
+ // guarantees the result of glGetString to point to a
+ // static string as long as our OpenGL context is valid
mExtensions = buffer;
}
inline bool hasNPot() const { return mHasNPot; }
- inline bool hasDrawPath() const { return mHasDrawPath; }
- inline bool hasCoverageSample() const { return mHasCoverageSample; }
inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
+ inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; }
bool hasExtension(const char* extension) const {
const String8 s(extension);
@@ -85,8 +96,7 @@ private:
const char* mExtensions;
bool mHasNPot;
- bool mHasDrawPath;
- bool mHasCoverageSample;
+ bool mNeedsHighpTexCoords;
bool mHasFramebufferFetch;
}; // class Extensions