| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 this->setVsync(false); | 77 this->setVsync(false); |
| 78 this->resetContext(); | 78 this->resetContext(); |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void VisualBench::resetContext() { | 82 void VisualBench::resetContext() { |
| 83 fSurface.reset(nullptr); | 83 fSurface.reset(nullptr); |
| 84 | 84 |
| 85 fInterface.reset(GrGLCreateNativeInterface()); | 85 fInterface.reset(GrGLCreateNativeInterface()); |
| 86 | 86 |
| 87 // TODO use the GLContext creation factories | 87 // TODO use the GLContext creation factories and also set this all up in con
figs |
| 88 fInterface.reset(GrGLInterfaceRemoveNVPR(fInterface)); | 88 if (!FLAGS_nvpr) { |
| 89 fInterface.reset(GrGLInterfaceRemoveNVPR(fInterface)); |
| 90 } |
| 89 SkASSERT(fInterface); | 91 SkASSERT(fInterface); |
| 90 | 92 |
| 91 // setup contexts | 93 // setup contexts |
| 92 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); | 94 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); |
| 93 SkASSERT(fContext); | 95 SkASSERT(fContext); |
| 94 | 96 |
| 95 // setup rendertargets | 97 // setup rendertargets |
| 96 this->setupRenderTarget(); | 98 this->setupRenderTarget(); |
| 97 } | 99 } |
| 98 | 100 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 141 } |
| 140 | 142 |
| 141 void application_term() { | 143 void application_term() { |
| 142 SkEvent::Term(); | 144 SkEvent::Term(); |
| 143 } | 145 } |
| 144 | 146 |
| 145 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 147 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 146 return new VisualBench(hwnd, argc, argv); | 148 return new VisualBench(hwnd, argc, argv); |
| 147 } | 149 } |
| 148 | 150 |
| OLD | NEW |