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

Unified Diff: src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm

Issue 639793002: Revert of Make the Sk GL context class an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/glx/SkNativeGLContext_glx.cpp ('k') | src/gpu/gl/iOS/SkNativeGLContext_iOS.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
diff --git a/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm b/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
deleted file mode 100644
index ce44dd37eec257e91727f45d71da8dba08ac5d2c..0000000000000000000000000000000000000000
--- a/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
+++ /dev/null
@@ -1,81 +0,0 @@
-
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "gl/SkGLContext.h"
-#import <OpenGLES/EAGL.h>
-
-#define EAGLCTX ((EAGLContext*)(fEAGLContext))
-
-namespace {
-
-class IOSNativeGLContext : public SkNativeGLContext {
-public:
- IOSNativeGLContext();
-
- virtual ~IOSNativeGLContext();
-
- virtual void makeCurrent() const SK_OVERRIDE;
- virtual void swapBuffers() const SK_OVERRIDE;
-protected:
- virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_OVERRIDE;
- virtual void destroyGLContext() SK_OVERRIDE;
-
-private:
- void* fEAGLContext;
-};
-
-IOSNativeGLContext::IOSNativeGLContext()
- : fEAGLContext(NULL) {
-}
-
-IOSNativeGLContext::~IOSNativeGLContext() {
- this->destroyGLContext();
-}
-
-void IOSNativeGLContext::destroyGLContext() {
- if (fEAGLContext) {
- if ([EAGLContext currentContext] == EAGLCTX) {
- [EAGLContext setCurrentContext:nil];
- }
- [EAGLCTX release];
- fEAGLContext = NULL;
- }
-}
-
-const GrGLInterface* IOSNativeGLContext::createGLContext(GrGLStandard forcedGpuAPI) {
- if (kGL_GrGLStandard == forcedGpuAPI) {
- return NULL;
- }
-
- fEAGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
- [EAGLContext setCurrentContext:EAGLCTX];
-
- const GrGLInterface* interface = GrGLCreateNativeInterface();
- if (!interface) {
- SkDebugf("Failed to create gl interface");
- this->destroyGLContext();
- return NULL;
- }
- return interface;
-}
-
-void IOSNativeGLContext::makeCurrent() const {
- if (![EAGLContext setCurrentContext:EAGLCTX]) {
- SkDebugf("Could not set the context.\n");
- }
-}
-
-void IOSNativeGLContext::swapBuffers() const { }
-
-} // anonymous namespace
-
-
-SkNativeGLContext* SkCreatePlatformGLContext() {
- return SkNEW(IOSNativeGLContext);
-}
-
« no previous file with comments | « src/gpu/gl/glx/SkNativeGLContext_glx.cpp ('k') | src/gpu/gl/iOS/SkNativeGLContext_iOS.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698