| Index: src/gpu/gl/android/SkNativeGLContext_android.cpp
|
| diff --git a/src/gpu/gl/android/SkNativeGLContext_android.cpp b/src/gpu/gl/android/SkNativeGLContext_android.cpp
|
| index 462109a6c4867688ac5cada88bf92701fbfd41a9..ae4a0c65730b3834bf528b4456ae908c690059a3 100644
|
| --- a/src/gpu/gl/android/SkNativeGLContext_android.cpp
|
| +++ b/src/gpu/gl/android/SkNativeGLContext_android.cpp
|
| @@ -51,7 +51,7 @@ void SkNativeGLContext::destroyGLContext() {
|
| }
|
| }
|
|
|
| -const GrGLInterface* SkNativeGLContext::createGLContext() {
|
| +const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedStandard) {
|
| static const EGLint kEGLContextAttribsForOpenGL[] = {
|
| EGL_NONE
|
| };
|
| @@ -81,9 +81,18 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
|
| },
|
| };
|
|
|
| + size_t apiLimit = SK_ARRAY_COUNT(kAPIs);
|
| + size_t api = 0;
|
| + if (forcedStandard == kGL_GrGLStandard) {
|
| + apiLimit = 1;
|
| + } else if (forcedStandard == kGLES_GrGLStandard) {
|
| + api = 1;
|
| + }
|
| + SkASSERT(forcedStandard == kNone_GrGLStandard || kAPIs[api].fStandard == forcedStandard);
|
| +
|
| const GrGLInterface* interface = NULL;
|
|
|
| - for (size_t api = 0; NULL == interface && api < SK_ARRAY_COUNT(kAPIs); ++api) {
|
| + for (size_t i = 0; NULL == interface && i < apiLimit; ++api) {
|
| fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
|
|
| EGLint majorVersion;
|
|
|