| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 INHERITED::detach(); | 98 INHERITED::detach(); |
| 99 return false; | 99 return false; |
| 100 } | 100 } |
| 101 | 101 |
| 102 this->setVsync(false); | 102 this->setVsync(false); |
| 103 this->resetContext(); | 103 this->resetContext(); |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void VisualBench::resetContext() { | 107 void VisualBench::resetContext() { |
| 108 fSurface.reset(NULL); |
| 109 |
| 108 fInterface.reset(GrGLCreateNativeInterface()); | 110 fInterface.reset(GrGLCreateNativeInterface()); |
| 109 SkASSERT(fInterface); | 111 SkASSERT(fInterface); |
| 110 | 112 |
| 111 // setup contexts | 113 // setup contexts |
| 112 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); | 114 fContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInter
face.get())); |
| 113 SkASSERT(fContext); | 115 SkASSERT(fContext); |
| 114 | 116 |
| 115 // setup rendertargets | 117 // setup rendertargets |
| 116 this->setupRenderTarget(); | 118 this->setupRenderTarget(); |
| 117 } | 119 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 275 |
| 274 void application_term() { | 276 void application_term() { |
| 275 SkEvent::Term(); | 277 SkEvent::Term(); |
| 276 SkGraphics::Term(); | 278 SkGraphics::Term(); |
| 277 } | 279 } |
| 278 | 280 |
| 279 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 281 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 280 return new VisualBench(hwnd, argc, argv); | 282 return new VisualBench(hwnd, argc, argv); |
| 281 } | 283 } |
| 282 | 284 |
| OLD | NEW |