| 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 #include "BitmapRegionDecoderBench.h" | 8 #include "BitmapRegionDecoderBench.h" |
| 9 #include "CodecBenchPriv.h" | 9 #include "CodecBenchPriv.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 const char* BitmapRegionDecoderBench::onGetName() { | 30 const char* BitmapRegionDecoderBench::onGetName() { |
| 31 return fName.c_str(); | 31 return fName.c_str(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { | 34 bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { |
| 35 return kNonRendering_Backend == backend; | 35 return kNonRendering_Backend == backend; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void BitmapRegionDecoderBench::onDelayedSetup() { | 38 void BitmapRegionDecoderBench::onDelayedSetup() { |
| 39 fBRD.reset(SkBitmapRegionDecoder::Create(fData.get(), | 39 fBRD.reset(SkBitmapRegionDecoder::Create(fData, SkBitmapRegionDecoder::kAndr
oidCodec_Strategy)); |
| 40 SkBitmapRegionDecoder::kAndroidCode
c_Strategy)); | |
| 41 } | 40 } |
| 42 | 41 |
| 43 void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { | 42 void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { |
| 44 for (int i = 0; i < n; i++) { | 43 for (int i = 0; i < n; i++) { |
| 45 SkBitmap bm; | 44 SkBitmap bm; |
| 46 SkAssertResult(fBRD->decodeRegion(&bm, nullptr, fSubset, fSampleSize, fC
olorType, false)); | 45 SkAssertResult(fBRD->decodeRegion(&bm, nullptr, fSubset, fSampleSize, fC
olorType, false)); |
| 47 } | 46 } |
| 48 } | 47 } |
| OLD | NEW |