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

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

Issue 23534045: Fix ES2 context init. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 EGL_NONE 61 EGL_NONE
62 }; 62 };
63 63
64 // Try first for OpenGL, then fall back to OpenGL ES. 64 // Try first for OpenGL, then fall back to OpenGL ES.
65 EGLint renderableTypeBit = EGL_OPENGL_BIT; 65 EGLint renderableTypeBit = EGL_OPENGL_BIT;
66 const EGLint* contextAttribs = kEGLContextAttribsForOpenGL; 66 const EGLint* contextAttribs = kEGLContextAttribsForOpenGL;
67 EGLBoolean apiBound = eglBindAPI(EGL_OPENGL_API); 67 EGLBoolean apiBound = eglBindAPI(EGL_OPENGL_API);
68 68
69 if (!apiBound) { 69 if (!apiBound) {
70 apiBound = eglBindAPI(EGL_OPENGL_ES_API); 70 apiBound = eglBindAPI(EGL_OPENGL_ES_API);
71 renderableTypeBit = EGL_OPENGL_ES_BIT; 71 renderableTypeBit = EGL_OPENGL_ES2_BIT;
72 contextAttribs = kEGLContextAttribsForOpenGLES; 72 contextAttribs = kEGLContextAttribsForOpenGLES;
73 } 73 }
74 74
75 if (!apiBound) { 75 if (!apiBound) {
76 return NULL; 76 return NULL;
77 } 77 }
78 78
79 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); 79 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
80 80
81 EGLint majorVersion; 81 EGLint majorVersion;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 return interface; 134 return interface;
135 } 135 }
136 136
137 void SkNativeGLContext::makeCurrent() const { 137 void SkNativeGLContext::makeCurrent() const {
138 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) { 138 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
139 SkDebugf("Could not set the context.\n"); 139 SkDebugf("Could not set the context.\n");
140 } 140 }
141 } 141 }
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