blob: 5e4b2e49176b2b5d552dbc35f6dcf8ff5941a208 [file] [log] [blame]
kkinnunen9e61bb72014-10-09 05:24:15 -07001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8#include "gl/SkGLContext.h"
9
10#include <GLES2/gl2.h>
11#include <EGL/egl.h>
12
13namespace {
14class NACLGLContext : public SkGLContext {
15public:
16 SkGLContextEGL();
17
18 virtual ~NACLGLContext();
19
20 virtual void makeCurrent() const SK_OVERRIDE;
21 virtual void swapBuffers() const SK_OVERRIDE;
22protected:
23 virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_OVERRIDE;
24 virtual void destroyGLContext() SK_OVERRIDE;
25
26private:
27 EGLContext fContext;
28 EGLDisplay fDisplay;
29 EGLSurface fSurface;
30};
31
32NACLGLContext::NACLGLContext()
33 : fContext(NULL)
34 , fDisplay(NULL)
35{
36}
37
38NACLGLContext::~NACLGLContext() {
39 this->destroyGLContext();
40}
41
42void NACLGLContext::destroyGLContext() {
43}
44
45const GrGLInterface* NACLGLContext::createGLContext(GrGLStandard forcedGpuAPI) {
46 return NULL;
47}
48
49void NACLGLContext::makeCurrent() const {
50}
51
52void NACLGLContext::swapBuffers() const {
53}
54
55} // anonymous namespace
56
57NACLGLContext* SkCreatePlatformGLContext() {
58 return SkNEW(NACLGLContext);
59}
60