Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2512)

Unified Diff: dm/DM.cpp

Issue 1288963002: Provides multiple implementations of Android's SkBitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 9dcdff1a0fce6f98f10228d33595e618a31f4c2e..7c8d37d86023c9704e0ed7e8aaf53f3aa72b6c77 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -268,6 +268,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,
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kNormal_Mode,
+ kN32_SkColorType, sampleSize));
+ push_src("image", "brd_canvas_subset_kN32", new BRDSrc(path,
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kSubset_Mode,
+ kN32_SkColorType, sampleSize));
+ push_src("image", "brd_canvas_k565", new BRDSrc(path,
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kNormal_Mode,
+ kRGB_565_SkColorType, sampleSize));
+ push_src("image", "brd_canvas_subset_k565", new BRDSrc(path,
+ SkBitmapRegionDecoder::kCanvas_Strategy, BRDSrc::kSubset_Mode,
+ kRGB_565_SkColorType, sampleSize));
+
+ // Sample Strategy supports N32, 565, Alpha8, and Index8
+ push_src("image", "brd_sample_kN32", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kNormal_Mode,
+ kN32_SkColorType, sampleSize));
+ push_src("image", "brd_sample_subset_kN32", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kSubset_Mode,
+ kN32_SkColorType, sampleSize));
+ push_src("image", "brd_sample_k565", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kNormal_Mode,
+ kRGB_565_SkColorType, sampleSize));
+ push_src("image", "brd_sample_subset_k565", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kSubset_Mode,
+ kRGB_565_SkColorType, sampleSize));
+ push_src("image", "brd_sample_kAlpha", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kNormal_Mode,
+ kAlpha_8_SkColorType, sampleSize));
+ push_src("image", "brd_sample_subset_kAlpha", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kSubset_Mode,
+ kAlpha_8_SkColorType, sampleSize));
+ push_src("image", "brd_sample_kIndex", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kNormal_Mode,
+ kIndex_8_SkColorType, sampleSize));
+ push_src("image", "brd_sample_subset_kIndex", new BRDSrc(path,
+ SkBitmapRegionDecoder::kSample_Strategy, BRDSrc::kSubset_Mode,
+ kIndex_8_SkColorType, sampleSize));
+ }
+
+}
+
static bool codec_supported(const char* ext) {
// 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).
@@ -315,6 +366,7 @@ static void gather_srcs() {
if (codec_supported(exts[j])) {
push_codec_srcs(path);
}
+ push_brd_srcs(path);
}
}
} else if (sk_exists(flag)) {
@@ -322,6 +374,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);
}
}
}
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698