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

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

Issue 1528473002: Revert of 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 #ifdef SK_BUILD_FOR_WIN 183 SkGLContext* ctx = SkANGLEGLContext::Create(this->gl()->fStandard, fIsGLBack end);
184 SkGLContext* ctx = fIsGLBackend ? SkANGLEGLContext::CreateOpenGL()
185 : SkANGLEGLContext::CreateDirectX();
186 #else
187 SkGLContext* ctx = SkANGLEGLContext::CreateOpenGL();
188 #endif
189 if (ctx) { 184 if (ctx) {
190 ctx->makeCurrent(); 185 ctx->makeCurrent();
191 } 186 }
192 return ctx; 187 return ctx;
193 } 188 }
194 189
195 void SkANGLEGLContext::destroyGLContext() { 190 void SkANGLEGLContext::destroyGLContext() {
196 if (fDisplay) { 191 if (fDisplay) {
197 eglMakeCurrent(fDisplay, 0, 0, 0); 192 eglMakeCurrent(fDisplay, 0, 0, 0);
198 193
(...skipping 20 matching lines...) Expand all
219 214
220 void SkANGLEGLContext::onPlatformSwapBuffers() const { 215 void SkANGLEGLContext::onPlatformSwapBuffers() const {
221 if (!eglSwapBuffers(fDisplay, fSurface)) { 216 if (!eglSwapBuffers(fDisplay, fSurface)) {
222 SkDebugf("Could not complete eglSwapBuffers.\n"); 217 SkDebugf("Could not complete eglSwapBuffers.\n");
223 } 218 }
224 } 219 }
225 220
226 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { 221 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const {
227 return eglGetProcAddress(name); 222 return eglGetProcAddress(name);
228 } 223 }
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