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

Side by Side Diff: src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp

Issue 630843002: 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 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 #include "gl/SkNativeGLContext.h" 8 #include "gl/SkGLContext.h"
9 9
10 SkNativeGLContext::AutoContextRestore::AutoContextRestore() { 10 #include <GLES2/gl2.h>
11 } 11 #include <EGL/egl.h>
12 12
13 SkNativeGLContext::AutoContextRestore::~AutoContextRestore() { 13 namespace {
14 } 14 class SkGLContextNACL : public SkGLContext {
15 public:
16 SkGLContextEGL();
15 17
16 SkNativeGLContext::SkNativeGLContext() 18 virtual ~SkGLContextNACL();
19
20 virtual void makeCurrent() const SK_OVERRIDE;
21 virtual void swapBuffers() const SK_OVERRIDE;
22 protected:
23 virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_O VERRIDE;
24 virtual void destroyGLContext() SK_OVERRIDE;
25
26 private:
27 EGLContext fContext;
28 EGLDisplay fDisplay;
29 EGLSurface fSurface;
30 };
31
32 SkGLContextNACL::SkGLContextNACL()
17 : fContext(NULL) 33 : fContext(NULL)
18 , fDisplay(NULL) 34 , fDisplay(NULL)
19 { 35 {
20 } 36 }
21 37
22 SkNativeGLContext::~SkNativeGLContext() { 38 SkGLContextNACL::~SkGLContextNACL() {
23 this->destroyGLContext(); 39 this->destroyGLContext();
24 } 40 }
25 41
26 void SkNativeGLContext::destroyGLContext() { 42 void SkGLContextNACL::destroyGLContext() {
27 } 43 }
28 44
29 const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedGpuAP I) { 45 const GrGLInterface* SkGLContextNACL::createGLContext(GrGLStandard forcedGpuAPI) {
30 return NULL; 46 return NULL;
31 } 47 }
32 48
33 void SkNativeGLContext::makeCurrent() const { 49 void SkGLContextNACL::makeCurrent() const {
34 } 50 }
35 51
36 void SkNativeGLContext::swapBuffers() const { 52 void SkGLContextNACL::swapBuffers() const {
37 } 53 }
54
55 } // anonymous namespace
56
57 SkGLContextNACL* SkCreateGLContext() {
58 return SkNEW(SkGLContextNACL);
59 }
60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698