| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 8 |
| 9 #include "gl/SkGLContext.h" | 9 #include "gl/SkGLContext.h" |
| 10 | 10 |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #include <GL/GL.h> | 12 #include <GL/GL.h> |
| 13 #include "win/SkWGL.h" | 13 #include "win/SkWGL.h" |
| 14 | 14 |
| 15 #define WIN32_LEAN_AND_MEAN | 15 #define WIN32_LEAN_AND_MEAN |
| 16 #include <windows.h> | 16 #include <windows.h> |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class WinGLContext : public SkGLContext { | 20 class WinGLContext : public SkGLContext { |
| 21 public: | 21 public: |
| 22 WinGLContext(GrGLStandard forcedGpuAPI); | 22 WinGLContext(GrGLStandard forcedGpuAPI); |
| 23 » virtual ~WinGLContext() SK_OVERRIDE; | 23 » ~WinGLContext() SK_OVERRIDE; |
| 24 virtual void makeCurrent() const SK_OVERRIDE; | 24 void makeCurrent() const SK_OVERRIDE; |
| 25 virtual void swapBuffers() const SK_OVERRIDE; | 25 void swapBuffers() const SK_OVERRIDE; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 void destroyGLContext(); | 28 void destroyGLContext(); |
| 29 | 29 |
| 30 HWND fWindow; | 30 HWND fWindow; |
| 31 HDC fDeviceContext; | 31 HDC fDeviceContext; |
| 32 HGLRC fGlRenderContext; | 32 HGLRC fGlRenderContext; |
| 33 static ATOM gWC; | 33 static ATOM gWC; |
| 34 SkWGLPbufferContext* fPbufferContext; | 34 SkWGLPbufferContext* fPbufferContext; |
| 35 }; | 35 }; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { | 182 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { |
| 183 WinGLContext* ctx = SkNEW_ARGS(WinGLContext, (forcedGpuAPI)); | 183 WinGLContext* ctx = SkNEW_ARGS(WinGLContext, (forcedGpuAPI)); |
| 184 if (!ctx->isValid()) { | 184 if (!ctx->isValid()) { |
| 185 SkDELETE(ctx); | 185 SkDELETE(ctx); |
| 186 return NULL; | 186 return NULL; |
| 187 } | 187 } |
| 188 return ctx; | 188 return ctx; |
| 189 } | 189 } |
| 190 | 190 |
| OLD | NEW |