aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/gl
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-02-23 08:57:23 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-23 08:57:23 -0800
commit42380174ca509e78ab932fa8c6dae953e1eaaa5a (patch)
treefe233d7e7715e962fe0f8b6da2a85604d2c0ff7d /include/gpu/gl
parent332c729ceca3db4bde5b6382db5f67ba066ae48a (diff)
Use D3D11 backend for ANGLE when available.
Diffstat (limited to 'include/gpu/gl')
-rw-r--r--include/gpu/gl/angle/SkANGLEGLContext.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/gpu/gl/angle/SkANGLEGLContext.h b/include/gpu/gl/angle/SkANGLEGLContext.h
new file mode 100644
index 0000000000..774e0a215d
--- /dev/null
+++ b/include/gpu/gl/angle/SkANGLEGLContext.h
@@ -0,0 +1,49 @@
+
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkANGLEGLContext_DEFINED
+#define SkANGLEGLContext_DEFINED
+
+#if SK_ANGLE
+
+#include "gl/SkGLContext.h"
+
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
+
+class SkANGLEGLContext : public SkGLContext {
+public:
+ ~SkANGLEGLContext() SK_OVERRIDE;
+ void makeCurrent() const SK_OVERRIDE;
+ void swapBuffers() const SK_OVERRIDE;
+
+ static SkANGLEGLContext* Create(GrGLStandard forcedGpuAPI) {
+ if (kGL_GrGLStandard == forcedGpuAPI) {
+ return NULL;
+ }
+ SkANGLEGLContext* ctx = SkNEW(SkANGLEGLContext);
+ if (!ctx->isValid()) {
+ SkDELETE(ctx);
+ return NULL;
+ }
+ return ctx;
+ }
+
+ static EGLDisplay GetD3DEGLDisplay(EGLNativeDisplayType nativeDisplay);
+
+private:
+ SkANGLEGLContext();
+ void destroyGLContext();
+
+ EGLContext fContext;
+ EGLDisplay fDisplay;
+ EGLSurface fSurface;
+};
+
+#endif
+
+#endif