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

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

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 5 years 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 | « src/gpu/gl/SkNullGLContext.cpp ('k') | src/gpu/gl/debug/SkDebugGLContext.h » ('j') | 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 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/angle/SkANGLEGLContext.h" 9 #include "gl/angle/SkANGLEGLContext.h"
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 glEGLImageTargetTexture2D(GR_GL_TEXTURE_EXTERNAL, image); 174 glEGLImageTargetTexture2D(GR_GL_TEXTURE_EXTERNAL, image);
175 if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) { 175 if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) {
176 GR_GL_CALL(this->gl(), DeleteTextures(1, &texID)); 176 GR_GL_CALL(this->gl(), DeleteTextures(1, &texID));
177 return 0; 177 return 0;
178 } 178 }
179 return texID; 179 return texID;
180 } 180 }
181 181
182 SkGLContext* SkANGLEGLContext::createNew() const { 182 SkGLContext* SkANGLEGLContext::createNew() const {
183 SkGLContext* ctx = SkANGLEGLContext::Create(this->gl()->fStandard, fIsGLBack end); 183 #ifdef SK_BUILD_FOR_WIN
184 SkGLContext* ctx = fIsGLBackend ? SkANGLEGLContext::CreateOpenGL()
185 : SkANGLEGLContext::CreateDirectX();
186 #else
187 SkGLContext* ctx = SkANGLEGLContext::CreateOpenGL();
188 #endif
184 if (ctx) { 189 if (ctx) {
185 ctx->makeCurrent(); 190 ctx->makeCurrent();
186 } 191 }
187 return ctx; 192 return ctx;
188 } 193 }
189 194
190 void SkANGLEGLContext::destroyGLContext() { 195 void SkANGLEGLContext::destroyGLContext() {
191 if (fDisplay) { 196 if (fDisplay) {
192 eglMakeCurrent(fDisplay, 0, 0, 0); 197 eglMakeCurrent(fDisplay, 0, 0, 0);
193 198
(...skipping 20 matching lines...) Expand all
214 219
215 void SkANGLEGLContext::onPlatformSwapBuffers() const { 220 void SkANGLEGLContext::onPlatformSwapBuffers() const {
216 if (!eglSwapBuffers(fDisplay, fSurface)) { 221 if (!eglSwapBuffers(fDisplay, fSurface)) {
217 SkDebugf("Could not complete eglSwapBuffers.\n"); 222 SkDebugf("Could not complete eglSwapBuffers.\n");
218 } 223 }
219 } 224 }
220 225
221 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { 226 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const {
222 return eglGetProcAddress(name); 227 return eglGetProcAddress(name);
223 } 228 }
OLDNEW
« no previous file with comments | « src/gpu/gl/SkNullGLContext.cpp ('k') | src/gpu/gl/debug/SkDebugGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698