aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/win/SkNativeGLContext_win.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-20 21:09:45 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-20 21:09:45 +0000
commitd47fafe05743d61958397bcf7a4b2bf66d778e1d (patch)
treefac9722ac2921f86840813c7d0792be28851a7ca /src/gpu/win/SkNativeGLContext_win.cpp
parentffa11bbbedd201899eb93bf05089c511f53d5c2a (diff)
Add test that validates GrGLInterfaces
Review URL: http://codereview.appspot.com/5304048/ git-svn-id: http://skia.googlecode.com/svn/trunk@2510 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/win/SkNativeGLContext_win.cpp')
-rw-r--r--src/gpu/win/SkNativeGLContext_win.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gpu/win/SkNativeGLContext_win.cpp b/src/gpu/win/SkNativeGLContext_win.cpp
index c19f7cca45..5d518dd138 100644
--- a/src/gpu/win/SkNativeGLContext_win.cpp
+++ b/src/gpu/win/SkNativeGLContext_win.cpp
@@ -11,12 +11,23 @@
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
+SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
+ fOldHGLRC = wglGetCurrentContext();
+ fOldHDC = wglGetCurrentDC();
+}
+
+SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
+ wglMakeCurrent(fOldHDC, fOldHGLRC);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
ATOM SkNativeGLContext::gWC = 0;
SkNativeGLContext::SkNativeGLContext()
- : fWindow(NULL)
- , fDeviceContext(NULL)
- , fGlRenderContext(0) {
+ : fWindow(NULL)
+ , fDeviceContext(NULL)
+ , fGlRenderContext(0) {
}
SkNativeGLContext::~SkNativeGLContext() {