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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 SkSurface* VisualBench::createSurface() { | 94 SkSurface* VisualBench::createSurface() { |
95 SkSurfaceProps props(INHERITED::getSurfaceProps()); | 95 SkSurfaceProps props(INHERITED::getSurfaceProps()); |
96 return SkSurface::NewRenderTargetDirect(fRenderTarget, &props); | 96 return SkSurface::NewRenderTargetDirect(fRenderTarget, &props); |
97 } | 97 } |
98 | 98 |
99 bool VisualBench::setupBackend() { | 99 bool VisualBench::setupBackend() { |
100 this->setColorType(kRGBA_8888_SkColorType); | 100 this->setColorType(kRGBA_8888_SkColorType); |
101 this->setVisibleP(true); | 101 this->setVisibleP(true); |
102 this->setClipToBounds(false); | 102 this->setClipToBounds(false); |
103 | 103 |
| 104 this->setFullscreen(true); |
104 if (!this->attach(kNativeGL_BackEndType, FLAGS_msaa, &fAttachmentInfo)) { | 105 if (!this->attach(kNativeGL_BackEndType, FLAGS_msaa, &fAttachmentInfo)) { |
105 SkDebugf("Not possible to create backend.\n"); | 106 SkDebugf("Not possible to create backend.\n"); |
106 INHERITED::detach(); | 107 INHERITED::detach(); |
107 return false; | 108 return false; |
108 } | 109 } |
109 | 110 |
110 this->setFullscreen(true); | |
111 this->setVsync(false); | 111 this->setVsync(false); |
112 this->resetContext(); | 112 this->resetContext(); |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 void VisualBench::resetContext() { | 116 void VisualBench::resetContext() { |
117 fInterface.reset(GrGLCreateNativeInterface()); | 117 fInterface.reset(GrGLCreateNativeInterface()); |
118 SkASSERT(fInterface); | 118 SkASSERT(fInterface); |
119 | 119 |
120 // setup contexts | 120 // setup contexts |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 void application_term() { | 225 void application_term() { |
226 SkEvent::Term(); | 226 SkEvent::Term(); |
227 SkGraphics::Term(); | 227 SkGraphics::Term(); |
228 } | 228 } |
229 | 229 |
230 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 230 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
231 return new VisualBench(hwnd, argc, argv); | 231 return new VisualBench(hwnd, argc, argv); |
232 } | 232 } |
233 | 233 |
OLD | NEW |