| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "VisualBench.h" | 9 #include "VisualBench.h" |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 this->setVsync(false); | 76 this->setVsync(false); |
| 77 this->resetContext(); | 77 this->resetContext(); |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void VisualBench::resetContext() { | 81 void VisualBench::resetContext() { |
| 82 fSurface.reset(nullptr); | 82 fSurface.reset(nullptr); |
| 83 | 83 |
| 84 fInterface.reset(GrGLCreateNativeInterface()); | 84 fInterface.reset(GrGLCreateNativeInterface()); |
| 85 |
| 86 // TODO use the GLContext creation factories |
| 87 fInterface.reset(GrGLInterfaceRemoveNVPR(fInterface)); |
| 85 SkASSERT(fInterface); | 88 SkASSERT(fInterface); |
| 86 | 89 |
| 87 // setup contexts | 90 // setup contexts |
| 88 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); | 91 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); |
| 89 SkASSERT(fContext); | 92 SkASSERT(fContext); |
| 90 | 93 |
| 91 // setup rendertargets | 94 // setup rendertargets |
| 92 this->setupRenderTarget(); | 95 this->setupRenderTarget(); |
| 93 } | 96 } |
| 94 | 97 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 138 } |
| 136 | 139 |
| 137 void application_term() { | 140 void application_term() { |
| 138 SkEvent::Term(); | 141 SkEvent::Term(); |
| 139 } | 142 } |
| 140 | 143 |
| 141 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 144 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 142 return new VisualBench(hwnd, argc, argv); | 145 return new VisualBench(hwnd, argc, argv); |
| 143 } | 146 } |
| 144 | 147 |
| OLD | NEW |