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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { | 55 bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { |
56 return kNonRendering_Backend == backend; | 56 return kNonRendering_Backend == backend; |
57 } | 57 } |
58 | 58 |
59 void BitmapRegionDecoderBench::onDelayedSetup() { | 59 void BitmapRegionDecoderBench::onDelayedSetup() { |
60 fBRD.reset(SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(fData,
fStrategy)); | 60 fBRD.reset(SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(fData,
fStrategy)); |
61 } | 61 } |
62 | 62 |
63 void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { | 63 void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { |
64 SkAutoTDelete<SkBitmap> bitmap; | |
65 for (int i = 0; i < n; i++) { | 64 for (int i = 0; i < n; i++) { |
66 bitmap.reset(fBRD->decodeRegion(fSubset.left(), fSubset.top(), fSubset.w
idth(), | 65 SkBitmap bm; |
67 fSubset.height(), fSampleSize, fColorType)); | 66 SkAssertResult(fBRD->decodeRegion(&bm, nullptr, fSubset, fSampleSize, fC
olorType, false)); |
68 SkASSERT(nullptr != bitmap.get()); | |
69 } | 67 } |
70 } | 68 } |
OLD | NEW |