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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 void VisualBench::setupRenderTarget() { | 118 void VisualBench::setupRenderTarget() { |
119 if (fContext) { | 119 if (fContext) { |
120 fRenderTarget.reset(this->renderTarget(fAttachmentInfo, fInterface, fCon
text)); | 120 fRenderTarget.reset(this->renderTarget(fAttachmentInfo, fInterface, fCon
text)); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 inline void VisualBench::renderFrame(SkCanvas* canvas) { | 124 inline void VisualBench::renderFrame(SkCanvas* canvas) { |
125 canvas->drawPicture(fPicture); | 125 canvas->drawPicture(fPicture); |
126 fContext->flush(); | 126 canvas->flush(); |
127 INHERITED::present(); | 127 INHERITED::present(); |
128 } | 128 } |
129 | 129 |
130 void VisualBench::printStats() { | 130 void VisualBench::printStats() { |
131 const SkTArray<double>& measurements = fRecords[fCurrentPictureIdx].fMeasure
ments; | 131 const SkTArray<double>& measurements = fRecords[fCurrentPictureIdx].fMeasure
ments; |
132 SkString shortName = SkOSPath::Basename(fRecords[fCurrentPictureIdx].fFilena
me.c_str()); | 132 SkString shortName = SkOSPath::Basename(fRecords[fCurrentPictureIdx].fFilena
me.c_str()); |
133 if (FLAGS_verbose) { | 133 if (FLAGS_verbose) { |
134 for (int i = 0; i < measurements.count(); i++) { | 134 for (int i = 0; i < measurements.count(); i++) { |
135 SkDebugf("%s ", HUMANIZE(measurements[i])); | 135 SkDebugf("%s ", HUMANIZE(measurements[i])); |
136 } | 136 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 void application_term() { | 241 void application_term() { |
242 SkEvent::Term(); | 242 SkEvent::Term(); |
243 SkGraphics::Term(); | 243 SkGraphics::Term(); |
244 } | 244 } |
245 | 245 |
246 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 246 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
247 return new VisualBench(hwnd, argc, argv); | 247 return new VisualBench(hwnd, argc, argv); |
248 } | 248 } |
249 | 249 |
OLD | NEW |