Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1155)

Unified Diff: src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp

Issue 22856006: Recognize that ES3 supports texture storage. Add workaround for apparent Adreno bug. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/gpu/gl/GrGLInterface.cpp ('K') | « src/gpu/gl/GrGLUtil.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
===================================================================
--- src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp (revision 10811)
+++ src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp (working copy)
@@ -6,6 +6,7 @@
#include "gl/GrGLExtensions.h"
#include "gl/GrGLInterface.h"
+#include "gl/GrGLUtil.h"
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
@@ -23,6 +24,12 @@
if (!extensions.init(kES_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
return NULL;
}
+ const char* verStr = reinterpret_cast<const char*>(glGetString(GR_GL_VERSION));
+ GrGLVersion version = GrGLGetVersionFromString(verStr);
+ if (version < GR_GL_VER(2,0)) {
+ return NULL;
+ }
+
GrGLInterface* interface = new GrGLInterface;
glInterface.reset(interface);
interface->fBindingsExported = kES_GrGLBinding;
@@ -94,13 +101,21 @@
interface->fTexParameteri = glTexParameteri;
interface->fTexParameteriv = glTexParameteriv;
interface->fTexSubImage2D = glTexSubImage2D;
-#if GL_ARB_texture_storage
- interface->fTexStorage2D = glTexStorage2D;
-#elif GL_EXT_texture_storage
- interface->fTexStorage2D = glTexStorage2DEXT;
+
+ if (version >= GR_GL_VER(3,0)) {
+#if GL_ES_VERSION_3_0
+ interface->fTexStorage2D = glTexStorage2D;
#else
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
+ interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2D");
#endif
+ } else {
+#if GL_EXT_texture_storage
+ interface->fTexStorage2D = glTexStorage2DEXT;
+#else
+ interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
+#endif
+ }
+
#if GL_EXT_discard_framebuffer
interface->fDiscardFramebuffer = glDiscardFramebufferEXT;
#endif
« src/gpu/gl/GrGLInterface.cpp ('K') | « src/gpu/gl/GrGLUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698