| 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 26 matching lines...) Expand all Loading... |
| 37 fTimerTypes |= wall ? TimerData::kWall_Flag : 0; | 37 fTimerTypes |= wall ? TimerData::kWall_Flag : 0; |
| 38 fTimerTypes |= truncatedWall ? TimerData::kTruncatedWall_Flag : 0; | 38 fTimerTypes |= truncatedWall ? TimerData::kTruncatedWall_Flag : 0; |
| 39 fTimerTypes |= cpu ? TimerData::kCpu_Flag : 0; | 39 fTimerTypes |= cpu ? TimerData::kCpu_Flag : 0; |
| 40 fTimerTypes |= truncatedCpu ? TimerData::kTruncatedCpu_Flag : 0; | 40 fTimerTypes |= truncatedCpu ? TimerData::kTruncatedCpu_Flag : 0; |
| 41 fTimerTypes |= gpu ? TimerData::kGpu_Flag : 0; | 41 fTimerTypes |= gpu ? TimerData::kGpu_Flag : 0; |
| 42 } | 42 } |
| 43 | 43 |
| 44 Timer* PictureBenchmark::setupTimer(bool useGLTimer) { | 44 Timer* PictureBenchmark::setupTimer(bool useGLTimer) { |
| 45 #if SK_SUPPORT_GPU | 45 #if SK_SUPPORT_GPU |
| 46 if (useGLTimer && fRenderer != NULL && fRenderer->isUsingGpuDevice()) { | 46 if (useGLTimer && fRenderer != NULL && fRenderer->isUsingGpuDevice()) { |
| 47 return SkNEW_ARGS(Timer, (fRenderer->getGLContext())); | 47 return new Timer(fRenderer->getGLContext()); |
| 48 } | 48 } |
| 49 #endif | 49 #endif |
| 50 return SkNEW_ARGS(Timer, (NULL)); | 50 return new Timer(NULL); |
| 51 } | 51 } |
| 52 | 52 |
| 53 PictureRenderer* PictureBenchmark::setRenderer(sk_tools::PictureRenderer* render
er) { | 53 PictureRenderer* PictureBenchmark::setRenderer(sk_tools::PictureRenderer* render
er) { |
| 54 SkRefCnt_SafeAssign(fRenderer, renderer); | 54 SkRefCnt_SafeAssign(fRenderer, renderer); |
| 55 return renderer; | 55 return renderer; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void PictureBenchmark::run(SkPicture* pict, bool useMultiPictureDraw) { | 58 void PictureBenchmark::run(SkPicture* pict, bool useMultiPictureDraw) { |
| 59 SkASSERT(pict); | 59 SkASSERT(pict); |
| 60 if (NULL == pict) { | 60 if (NULL == pict) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 fTimerResult, | 237 fTimerResult, |
| 238 timerTypes, | 238 timerTypes, |
| 239 numInnerLoops); | 239 numInnerLoops); |
| 240 #endif | 240 #endif |
| 241 } | 241 } |
| 242 | 242 |
| 243 fRenderer->end(); | 243 fRenderer->end(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } | 246 } |
| OLD | NEW |