From a5aed0d58962a24c44728ffc46dc9e1ba2f9fda5 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 9 Sep 2010 14:42:43 -0700 Subject: Add support for advanced blend modes with the framebuffer. This adds the ability to blend with the framebuffer using Darken, Lighten, Add, Multiply, Overlay and Screen. Change-Id: Iae01a53797d4ad39c373cba6ff2a42293129da1a --- libs/hwui/Extensions.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/hwui/Extensions.h') diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h index 7778290..d50d36e 100644 --- a/libs/hwui/Extensions.h +++ b/libs/hwui/Extensions.h @@ -26,17 +26,33 @@ namespace android { namespace uirenderer { +/////////////////////////////////////////////////////////////////////////////// +// Defines +/////////////////////////////////////////////////////////////////////////////// + +// Debug +#define DEBUG_EXTENSIONS 0 + +// Debug +#if DEBUG_EXTENSIONS + #define EXT_LOGD(...) LOGD(__VA_ARGS__) +#else + #define EXT_LOGD(...) +#endif + class Extensions { public: Extensions() { const char* buffer = (const char*) glGetString(GL_EXTENSIONS); const char* current = buffer; const char* head = current; + EXT_LOGD("Available GL extensions:"); do { head = strchr(current, ' '); String8 s(current, head ? head - current : strlen(current)); if (s.length()) { mExtensionList.add(s); + EXT_LOGD(" %s", s.string()); } current = head + 1; } while (head); @@ -44,6 +60,7 @@ public: 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"); mExtensions = buffer; } @@ -51,6 +68,7 @@ public: inline bool hasNPot() const { return mHasNPot; } inline bool hasDrawPath() const { return mHasDrawPath; } inline bool hasCoverageSample() const { return mHasCoverageSample; } + inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } bool hasExtension(const char* extension) const { const String8 s(extension); @@ -69,6 +87,7 @@ private: bool mHasNPot; bool mHasDrawPath; bool mHasCoverageSample; + bool mHasFramebufferFetch; }; // class Extensions }; // namespace uirenderer -- cgit v1.1