OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "Timer.h" | 8 #include "Timer.h" |
9 #include "PictureBenchmark.h" | 9 #include "PictureBenchmark.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 if (fPreprocess) { | 75 if (fPreprocess) { |
76 if (NULL != fRenderer->getCanvas()) { | 76 if (NULL != fRenderer->getCanvas()) { |
77 fRenderer->getCanvas()->EXPERIMENTAL_optimize(pict); | 77 fRenderer->getCanvas()->EXPERIMENTAL_optimize(pict); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 fRenderer->render(NULL); | 81 fRenderer->render(NULL); |
82 fRenderer->resetState(true); // flush, swapBuffers and Finish | 82 fRenderer->resetState(true); // flush, swapBuffers and Finish |
83 | 83 |
84 if (fPreprocess) { | |
85 if (NULL != fRenderer->getCanvas()) { | |
86 fRenderer->getCanvas()->EXPERIMENTAL_purge(pict); | |
87 } | |
88 } | |
89 | |
90 if (fPurgeDecodedTex) { | 84 if (fPurgeDecodedTex) { |
91 fRenderer->purgeTextures(); | 85 fRenderer->purgeTextures(); |
92 } | 86 } |
93 | 87 |
94 bool usingGpu = false; | 88 bool usingGpu = false; |
95 #if SK_SUPPORT_GPU | 89 #if SK_SUPPORT_GPU |
96 usingGpu = fRenderer->isUsingGpuDevice(); | 90 usingGpu = fRenderer->isUsingGpuDevice(); |
97 #endif | 91 #endif |
98 | 92 |
99 uint32_t timerTypes = fTimerTypes; | 93 uint32_t timerTypes = fTimerTypes; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 fRenderer->setup(); | 207 fRenderer->setup(); |
214 | 208 |
215 perRunTimer->start(); | 209 perRunTimer->start(); |
216 fRenderer->render(NULL); | 210 fRenderer->render(NULL); |
217 perRunTimer->truncatedEnd(); | 211 perRunTimer->truncatedEnd(); |
218 fRenderer->resetState(false); // flush & swapBuffers, but don'
t Finish | 212 fRenderer->resetState(false); // flush & swapBuffers, but don'
t Finish |
219 perRunTimer->end(); | 213 perRunTimer->end(); |
220 | 214 |
221 SkAssertResult(perRunTimerData.appendTimes(perRunTimer.get())); | 215 SkAssertResult(perRunTimerData.appendTimes(perRunTimer.get())); |
222 | 216 |
223 if (fPreprocess) { | |
224 if (NULL != fRenderer->getCanvas()) { | |
225 fRenderer->getCanvas()->EXPERIMENTAL_purge(pict); | |
226 } | |
227 } | |
228 | |
229 if (fPurgeDecodedTex) { | 217 if (fPurgeDecodedTex) { |
230 fRenderer->purgeTextures(); | 218 fRenderer->purgeTextures(); |
231 } | 219 } |
232 } | 220 } |
233 longRunningTimer->truncatedEnd(); | 221 longRunningTimer->truncatedEnd(); |
234 fRenderer->resetState(true); // flush, swapBuffers and Finish | 222 fRenderer->resetState(true); // flush, swapBuffers and Finish |
235 longRunningTimer->end(); | 223 longRunningTimer->end(); |
236 SkAssertResult(longRunningTimerData.appendTimes(longRunningTimer.get
())); | 224 SkAssertResult(longRunningTimerData.appendTimes(longRunningTimer.get
())); |
237 } | 225 } |
238 | 226 |
(...skipping 17 matching lines...) Expand all Loading... |
256 fTimerResult, | 244 fTimerResult, |
257 timerTypes, | 245 timerTypes, |
258 numInnerLoops); | 246 numInnerLoops); |
259 #endif | 247 #endif |
260 } | 248 } |
261 | 249 |
262 fRenderer->end(); | 250 fRenderer->end(); |
263 } | 251 } |
264 | 252 |
265 } | 253 } |
OLD | NEW |