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

Side by Side Diff: src/gpu/gl/android/SkNativeGLContext_android.cpp

Issue 557363002: Fix iteration bounds of Android GL API initialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Avoid two conflicting declarations of api Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gl/SkNativeGLContext.h" 8 #include "gl/SkNativeGLContext.h"
9 9
10 SkNativeGLContext::AutoContextRestore::AutoContextRestore() { 10 SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 size_t api = 0; 85 size_t api = 0;
86 if (forcedGpuAPI == kGL_GrGLStandard) { 86 if (forcedGpuAPI == kGL_GrGLStandard) {
87 apiLimit = 1; 87 apiLimit = 1;
88 } else if (forcedGpuAPI == kGLES_GrGLStandard) { 88 } else if (forcedGpuAPI == kGLES_GrGLStandard) {
89 api = 1; 89 api = 1;
90 } 90 }
91 SkASSERT(forcedGpuAPI == kNone_GrGLStandard || kAPIs[api].fStandard == force dGpuAPI); 91 SkASSERT(forcedGpuAPI == kNone_GrGLStandard || kAPIs[api].fStandard == force dGpuAPI);
92 92
93 const GrGLInterface* interface = NULL; 93 const GrGLInterface* interface = NULL;
94 94
95 for (size_t i = 0; NULL == interface && i < apiLimit; ++api) { 95 for (; NULL == interface && api < apiLimit; ++api) {
96 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); 96 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
97 97
98 EGLint majorVersion; 98 EGLint majorVersion;
99 EGLint minorVersion; 99 EGLint minorVersion;
100 eglInitialize(fDisplay, &majorVersion, &minorVersion); 100 eglInitialize(fDisplay, &majorVersion, &minorVersion);
101 101
102 #if 0 102 #if 0
103 SkDebugf("VENDOR: %s\n", eglQueryString(fDisplay, EGL_VENDOR)); 103 SkDebugf("VENDOR: %s\n", eglQueryString(fDisplay, EGL_VENDOR));
104 SkDebugf("APIS: %s\n", eglQueryString(fDisplay, EGL_CLIENT_APIS)); 104 SkDebugf("APIS: %s\n", eglQueryString(fDisplay, EGL_CLIENT_APIS));
105 SkDebugf("VERSION: %s\n", eglQueryString(fDisplay, EGL_VERSION)); 105 SkDebugf("VERSION: %s\n", eglQueryString(fDisplay, EGL_VERSION));
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) { 173 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
174 SkDebugf("Could not set the context.\n"); 174 SkDebugf("Could not set the context.\n");
175 } 175 }
176 } 176 }
177 177
178 void SkNativeGLContext::swapBuffers() const { 178 void SkNativeGLContext::swapBuffers() const {
179 if (!eglSwapBuffers(fDisplay, fSurface)) { 179 if (!eglSwapBuffers(fDisplay, fSurface)) {
180 SkDebugf("Could not complete eglSwapBuffers.\n"); 180 SkDebugf("Could not complete eglSwapBuffers.\n");
181 } 181 }
182 } 182 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698