| 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/GLTestContext.h" | 9 #include "gl/GLTestContext.h" |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 SkWGLContextRequest contextType = | 85 SkWGLContextRequest contextType = |
| 86 kGLES_GrGLStandard == forcedGpuAPI ? | 86 kGLES_GrGLStandard == forcedGpuAPI ? |
| 87 kGLES_SkWGLContextRequest : kGLPreferCompatibilityProfile_SkWGLContextRe
quest; | 87 kGLES_SkWGLContextRequest : kGLPreferCompatibilityProfile_SkWGLContextRe
quest; |
| 88 | 88 |
| 89 fPbufferContext = SkWGLPbufferContext::Create(fDeviceContext, 0, contextType
); | 89 fPbufferContext = SkWGLPbufferContext::Create(fDeviceContext, 0, contextType
); |
| 90 | 90 |
| 91 HDC dc; | 91 HDC dc; |
| 92 HGLRC glrc; | 92 HGLRC glrc; |
| 93 | 93 |
| 94 if (nullptr == fPbufferContext) { | 94 if (nullptr == fPbufferContext) { |
| 95 if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, contextTy
pe))) { | 95 if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, false, co
ntextType))) { |
| 96 SkDebugf("Could not create rendering context.\n"); | 96 SkDebugf("Could not create rendering context.\n"); |
| 97 this->destroyGLContext(); | 97 this->destroyGLContext(); |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 dc = fDeviceContext; | 100 dc = fDeviceContext; |
| 101 glrc = fGlRenderContext; | 101 glrc = fGlRenderContext; |
| 102 } else { | 102 } else { |
| 103 ReleaseDC(fWindow, fDeviceContext); | 103 ReleaseDC(fWindow, fDeviceContext); |
| 104 fDeviceContext = 0; | 104 fDeviceContext = 0; |
| 105 DestroyWindow(fWindow); | 105 DestroyWindow(fWindow); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 WinGLTestContext *ctx = new WinGLTestContext(forcedGpuAPI); | 197 WinGLTestContext *ctx = new WinGLTestContext(forcedGpuAPI); |
| 198 if (!ctx->isValid()) { | 198 if (!ctx->isValid()) { |
| 199 delete ctx; | 199 delete ctx; |
| 200 return nullptr; | 200 return nullptr; |
| 201 } | 201 } |
| 202 return ctx; | 202 return ctx; |
| 203 } | 203 } |
| 204 } // namespace sk_gpu_test | 204 } // namespace sk_gpu_test |
| 205 | 205 |
| OLD | NEW |