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

Side by Side Diff: src/gpu/gl/iOS/SkNativeGLContext_iOS.mm

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « src/gpu/gl/debug/SkDebugGLContext.cpp ('k') | src/gpu/gl/mac/SkNativeGLContext_mac.cpp » ('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/SkNativeGLContext.h" 9 #include "gl/SkNativeGLContext.h"
10 #import <OpenGLES/EAGL.h> 10 #import <OpenGLES/EAGL.h>
(...skipping 24 matching lines...) Expand all
35 this->destroyGLContext(); 35 this->destroyGLContext();
36 } 36 }
37 37
38 void SkNativeGLContext::destroyGLContext() { 38 void SkNativeGLContext::destroyGLContext() {
39 if ([EAGLContext currentContext] == EAGLCTX) { 39 if ([EAGLContext currentContext] == EAGLCTX) {
40 [EAGLContext setCurrentContext:nil]; 40 [EAGLContext setCurrentContext:nil];
41 } 41 }
42 [EAGLCTX release]; 42 [EAGLCTX release];
43 } 43 }
44 44
45 const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedGpuAP I) { 45 const GrGLInterface* SkNativeGLContext::createGLContext() {
46 if (kGL_GrGLStandard == forcedGpuAPI) {
47 return NULL;
48 }
49
50 fEAGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 46 fEAGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
51 [EAGLContext setCurrentContext:EAGLCTX]; 47 [EAGLContext setCurrentContext:EAGLCTX];
52 48
53 const GrGLInterface* interface = GrGLCreateNativeInterface(); 49 const GrGLInterface* interface = GrGLCreateNativeInterface();
54 if (!interface) { 50 if (!interface) {
55 SkDebugf("Failed to create gl interface"); 51 SkDebugf("Failed to create gl interface");
56 this->destroyGLContext(); 52 this->destroyGLContext();
57 return NULL; 53 return NULL;
58 } 54 }
59 return interface; 55 return interface;
60 } 56 }
61 57
62 void SkNativeGLContext::makeCurrent() const { 58 void SkNativeGLContext::makeCurrent() const {
63 if (![EAGLContext setCurrentContext:EAGLCTX]) { 59 if (![EAGLContext setCurrentContext:EAGLCTX]) {
64 SkDebugf("Could not set the context.\n"); 60 SkDebugf("Could not set the context.\n");
65 } 61 }
66 } 62 }
67 63
68 void SkNativeGLContext::swapBuffers() const { } 64 void SkNativeGLContext::swapBuffers() const { }
OLDNEW
« no previous file with comments | « src/gpu/gl/debug/SkDebugGLContext.cpp ('k') | src/gpu/gl/mac/SkNativeGLContext_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698