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

Side by Side Diff: src/gpu/gl/angle/SkANGLEGLContext.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add docs Created 6 years, 5 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 8
9 #include "gl/SkANGLEGLContext.h" 9 #include "gl/SkANGLEGLContext.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (fSurface) { 45 if (fSurface) {
46 eglDestroySurface(fDisplay, fSurface); 46 eglDestroySurface(fDisplay, fSurface);
47 fSurface = EGL_NO_SURFACE; 47 fSurface = EGL_NO_SURFACE;
48 } 48 }
49 49
50 //TODO should we close the display? 50 //TODO should we close the display?
51 fDisplay = EGL_NO_DISPLAY; 51 fDisplay = EGL_NO_DISPLAY;
52 } 52 }
53 } 53 }
54 54
55 const GrGLInterface* SkANGLEGLContext::createGLContext() { 55 const GrGLInterface* SkANGLEGLContext::createGLContext(GrGLStandard forcedGpuAPI ) {
56 if (kGL_GrGLStandard == forcedGpuAPI) {
57 return NULL;
58 }
56 59
57 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); 60 fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
58 61
59 EGLint majorVersion; 62 EGLint majorVersion;
60 EGLint minorVersion; 63 EGLint minorVersion;
61 eglInitialize(fDisplay, &majorVersion, &minorVersion); 64 eglInitialize(fDisplay, &majorVersion, &minorVersion);
62 65
63 EGLint numConfigs; 66 EGLint numConfigs;
64 static const EGLint configAttribs[] = { 67 static const EGLint configAttribs[] = {
65 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, 68 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) { 107 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
105 SkDebugf("Could not set the context.\n"); 108 SkDebugf("Could not set the context.\n");
106 } 109 }
107 } 110 }
108 111
109 void SkANGLEGLContext::swapBuffers() const { 112 void SkANGLEGLContext::swapBuffers() const {
110 if (!eglSwapBuffers(fDisplay, fSurface)) { 113 if (!eglSwapBuffers(fDisplay, fSurface)) {
111 SkDebugf("Could not complete eglSwapBuffers.\n"); 114 SkDebugf("Could not complete eglSwapBuffers.\n");
112 } 115 }
113 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698