Index: dm/DM.cpp |
diff --git a/dm/DM.cpp b/dm/DM.cpp |
index f5df692ca66cfce0c700bc02d8afa432f8da083a..5e628766b321749325a153f98ba196cd891ba0f1 100644 |
--- a/dm/DM.cpp |
+++ b/dm/DM.cpp |
@@ -282,6 +282,57 @@ static void push_codec_srcs(Path path) { |
} |
} |
+static void push_brd_srcs(Path path) { |
+ // Choose sample sizes to test. |
+ const uint32_t sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
+ |
+ for (uint32_t sampleSize : sampleSizes) { |
+ // Directly specify the color types that we want to test on. We will |
+ // only test on the 8888 backend to avoid duplication of tests. |
+ |
+ // Canvas Strategy supports N32 and 565 |
+ push_src("image", "brd_canvas_kN32", new BRDSrc(path, |
scroggo
2015/09/01 22:05:28
I think this can be cleaned up to behave similarly
msarett
2015/09/02 18:02:23
Yes it can! Done.
|
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kFullImage_Mode, |
+ kN32_SkColorType, sampleSize)); |
+ push_src("image", "brd_canvas_subset_kN32", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kDivisor_Mode, |
+ kN32_SkColorType, sampleSize)); |
+ push_src("image", "brd_canvas_k565", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kFullImage_Mode, |
+ kRGB_565_SkColorType, sampleSize)); |
+ push_src("image", "brd_canvas_subset_k565", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kDivisor_Mode, |
+ kRGB_565_SkColorType, sampleSize)); |
+ |
+ // Sample Strategy supports N32, 565, Alpha8, and Index8 |
+ push_src("image", "brd_sample_kN32", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kFullImage_Mode, |
+ kN32_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_subset_kN32", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kDivisor_Mode, |
+ kN32_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_k565", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kFullImage_Mode, |
+ kRGB_565_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_subset_k565", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kDivisor_Mode, |
+ kRGB_565_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_kAlpha", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kFullImage_Mode, |
+ kAlpha_8_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_subset_kAlpha", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kDivisor_Mode, |
+ kAlpha_8_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_kIndex", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kFullImage_Mode, |
+ kIndex_8_SkColorType, sampleSize)); |
+ push_src("image", "brd_sample_subset_kIndex", new BRDSrc(path, |
+ SkBitmapRegionDecoder::kOriginal_Strategy, BRDSrc::kDivisor_Mode, |
+ kIndex_8_SkColorType, sampleSize)); |
+ } |
+ |
+} |
+ |
static bool codec_supported(const char* ext) { |
scroggo
2015/09/01 22:05:28
I was glancing at this earlier - do we still need
msarett
2015/09/02 18:02:23
You are correct that it's no longer needed. I wil
|
// FIXME: Once other versions of SkCodec are available, we can add them to this |
// list (and eventually we can remove this check once they are all supported). |
@@ -329,6 +380,7 @@ static void gather_srcs() { |
if (codec_supported(exts[j])) { |
push_codec_srcs(path); |
} |
+ push_brd_srcs(path); |
} |
} |
} else if (sk_exists(flag)) { |
@@ -336,6 +388,7 @@ static void gather_srcs() { |
push_src("image", "decode", new ImageSrc(flag)); // Decode entire image. |
push_src("image", "subset", new ImageSrc(flag, 2)); // Decode into 2 x 2 subsets |
push_codec_srcs(flag); |
+ push_brd_srcs(flag); |
} |
} |
} |