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

Unified Diff: src/gpu/gl/angle/SkANGLEGLContext.cpp

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/SkGLContextHelper.cpp ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/angle/SkANGLEGLContext.cpp
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp
index 4914ba55333d70df73ccac437b940ac0db7b6085..81fccebba0cf08a9932d67a1a88abe1be89d0f41 100644
--- a/src/gpu/gl/angle/SkANGLEGLContext.cpp
+++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp
@@ -7,6 +7,21 @@
*/
#include "gl/SkANGLEGLContext.h"
+
+SkANGLEGLContext::AutoContextRestore::AutoContextRestore() {
+ fOldEGLContext = eglGetCurrentContext();
+ fOldDisplay = eglGetCurrentDisplay();
+ fOldSurface = eglGetCurrentSurface(EGL_DRAW);
+
+}
+
+SkANGLEGLContext::AutoContextRestore::~AutoContextRestore() {
+ if (fOldDisplay) {
+ eglMakeCurrent(fOldDisplay, fOldSurface, fOldSurface, fOldEGLContext);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
SkANGLEGLContext::SkANGLEGLContext()
: fContext(EGL_NO_CONTEXT)
« no previous file with comments | « src/gpu/gl/SkGLContextHelper.cpp ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698