diff options
author | msarett <msarett@google.com> | 2015-11-06 08:56:32 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-06 08:56:32 -0800 |
commit | 5cb4885b4cd1ac5eb3fc92dac5f5509d7c810464 (patch) | |
tree | 8edcbfa75ec122129136503140a85a2b55bdc6e5 /bench | |
parent | aa4ba90792a99eed96ac51006bd478d453a751c4 (diff) |
Rename SkBitmapRegionDecoder and Create function
We no longer need to worry about namespace
conflicts SkBitmapRegionDecoder in Android (which
we are replacing).
Additionally, the static Create() function does not
need to repeat the name BitmapRegionDecoder.
BUG=skia:
Review URL: https://codereview.chromium.org/1415243007
Diffstat (limited to 'bench')
-rw-r--r-- | bench/BitmapRegionDecoderBench.cpp | 10 | ||||
-rw-r--r-- | bench/BitmapRegionDecoderBench.h | 8 | ||||
-rw-r--r-- | bench/nanobench.cpp | 20 |
3 files changed, 19 insertions, 19 deletions
diff --git a/bench/BitmapRegionDecoderBench.cpp b/bench/BitmapRegionDecoderBench.cpp index 70e3e760e0..1d2a0b91f7 100644 --- a/bench/BitmapRegionDecoderBench.cpp +++ b/bench/BitmapRegionDecoderBench.cpp @@ -12,7 +12,7 @@ #include "SkOSFile.h" BitmapRegionDecoderBench::BitmapRegionDecoderBench(const char* baseName, SkData* encoded, - SkBitmapRegionDecoderInterface::Strategy strategy, SkColorType colorType, + SkBitmapRegionDecoder::Strategy strategy, SkColorType colorType, uint32_t sampleSize, const SkIRect& subset) : fBRD(nullptr) , fData(SkRef(encoded)) @@ -24,13 +24,13 @@ BitmapRegionDecoderBench::BitmapRegionDecoderBench(const char* baseName, SkData* // Choose a useful name for the region decoding strategy const char* strategyName; switch (strategy) { - case SkBitmapRegionDecoderInterface::kOriginal_Strategy: + case SkBitmapRegionDecoder::kOriginal_Strategy: strategyName = "Original"; break; - case SkBitmapRegionDecoderInterface::kCanvas_Strategy: + case SkBitmapRegionDecoder::kCanvas_Strategy: strategyName = "Canvas"; break; - case SkBitmapRegionDecoderInterface::kAndroidCodec_Strategy: + case SkBitmapRegionDecoder::kAndroidCodec_Strategy: strategyName = "AndroidCodec"; break; default: @@ -57,7 +57,7 @@ bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { } void BitmapRegionDecoderBench::onDelayedSetup() { - fBRD.reset(SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(fData, fStrategy)); + fBRD.reset(SkBitmapRegionDecoder::Create(fData, fStrategy)); } void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { diff --git a/bench/BitmapRegionDecoderBench.h b/bench/BitmapRegionDecoderBench.h index 3f3da6cec9..7c331aee31 100644 --- a/bench/BitmapRegionDecoderBench.h +++ b/bench/BitmapRegionDecoderBench.h @@ -9,7 +9,7 @@ #define BitmapRegionDecoderBench_DEFINED #include "Benchmark.h" -#include "SkBitmapRegionDecoderInterface.h" +#include "SkBitmapRegionDecoder.h" #include "SkData.h" #include "SkImageInfo.h" #include "SkRefCnt.h" @@ -27,7 +27,7 @@ class BitmapRegionDecoderBench : public Benchmark { public: // Calls encoded->ref() BitmapRegionDecoderBench(const char* basename, SkData* encoded, - SkBitmapRegionDecoderInterface::Strategy strategy, SkColorType colorType, + SkBitmapRegionDecoder::Strategy strategy, SkColorType colorType, uint32_t sampleSize, const SkIRect& subset); protected: @@ -38,9 +38,9 @@ protected: private: SkString fName; - SkAutoTDelete<SkBitmapRegionDecoderInterface> fBRD; + SkAutoTDelete<SkBitmapRegionDecoder> fBRD; SkAutoTUnref<SkData> fData; - const SkBitmapRegionDecoderInterface::Strategy fStrategy; + const SkBitmapRegionDecoder::Strategy fStrategy; const SkColorType fColorType; const uint32_t fSampleSize; const SkIRect fSubset; diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index 2e566da8e1..264e4a1378 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -26,7 +26,7 @@ #include "SubsetZoomBench.h" #include "Stats.h" -#include "SkBitmapRegionDecoderInterface.h" +#include "SkBitmapRegionDecoder.h" #include "SkBBoxHierarchy.h" #include "SkCanvas.h" #include "SkCodec.h" @@ -588,11 +588,11 @@ static bool valid_subset_bench(const SkString& path, SkColorType colorType, bool return true; } -static bool valid_brd_bench(SkData* encoded, SkBitmapRegionDecoderInterface::Strategy strategy, +static bool valid_brd_bench(SkData* encoded, SkBitmapRegionDecoder::Strategy strategy, SkColorType colorType, uint32_t sampleSize, uint32_t minOutputSize, int* width, int* height) { - SkAutoTDelete<SkBitmapRegionDecoderInterface> brd( - SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(encoded, strategy)); + SkAutoTDelete<SkBitmapRegionDecoder> brd( + SkBitmapRegionDecoder::Create(encoded, strategy)); if (nullptr == brd.get()) { // This is indicates that subset decoding is not supported for a particular image format. return false; @@ -956,12 +956,12 @@ public: // Run the BRDBenches // We will benchmark multiple BRD strategies. static const struct { - SkBitmapRegionDecoderInterface::Strategy fStrategy; + SkBitmapRegionDecoder::Strategy fStrategy; const char* fName; } strategies[] = { - { SkBitmapRegionDecoderInterface::kOriginal_Strategy, "BRD" }, - { SkBitmapRegionDecoderInterface::kCanvas_Strategy, "BRD_canvas" }, - { SkBitmapRegionDecoderInterface::kAndroidCodec_Strategy, "BRD_android_codec" }, + { SkBitmapRegionDecoder::kOriginal_Strategy, "BRD" }, + { SkBitmapRegionDecoder::kCanvas_Strategy, "BRD_canvas" }, + { SkBitmapRegionDecoder::kAndroidCodec_Strategy, "BRD_android_codec" }, }; // We intend to create benchmarks that model the use cases in @@ -986,10 +986,10 @@ public: fBenchType = strategies[fCurrentBRDStrategy].fName; const SkString& path = fImages[fCurrentBRDImage]; - const SkBitmapRegionDecoderInterface::Strategy strategy = + const SkBitmapRegionDecoder::Strategy strategy = strategies[fCurrentBRDStrategy].fStrategy; - if (SkBitmapRegionDecoderInterface::kOriginal_Strategy == strategy) { + if (SkBitmapRegionDecoder::kOriginal_Strategy == strategy) { // Disable png and jpeg for SkImageDecoder: if (!FLAGS_jpgBuildTileIndex) { if (path.endsWith("JPEG") || path.endsWith("JPG") || |