Index: dm/DM.cpp |
diff --git a/dm/DM.cpp b/dm/DM.cpp |
index 66cc272f2475d25264be812596b9f5d13a732035..b8b208ac366b4a4d0893b62d2fd4d56972bf0082 100644 |
--- a/dm/DM.cpp |
+++ b/dm/DM.cpp |
@@ -405,6 +405,8 @@ static void push_brd_srcs(Path path) { |
SkBitmapRegionDecoderInterface::kOriginal_Strategy |
}; |
+ const uint32_t sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
scroggo
2015/09/11 14:59:47
Why did this move?
(I'm fine with the new locatio
msarett
2015/09/11 15:28:20
Yes that's why.
|
+ |
// We will only test to one backend (8888), but we will test all of the |
// color types that we need to decode to on this backend. |
const CodecSrc::DstColorType dstColorTypes[] = { |
@@ -418,9 +420,8 @@ static void push_brd_srcs(Path path) { |
BRDSrc::kDivisor_Mode |
}; |
- const uint32_t sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
- |
for (SkBitmapRegionDecoderInterface::Strategy strategy : strategies) { |
+ |
// We disable png testing for kOriginal_Strategy because the implementation leaks |
// memory in our forked libpng. |
// TODO (msarett): Decide if we want to test pngs in this mode and how we might do this. |
@@ -428,10 +429,19 @@ static void push_brd_srcs(Path path) { |
(path.endsWith(".png") || path.endsWith(".PNG"))) { |
continue; |
} |
- for (CodecSrc::DstColorType dstColorType : dstColorTypes) { |
- if (brd_color_type_supported(strategy, dstColorType)) { |
- for (BRDSrc::Mode mode : modes) { |
- for (uint32_t sampleSize : sampleSizes) { |
+ for (uint32_t sampleSize : sampleSizes) { |
+ |
+ // kOriginal_Strategy does not work for jpegs that are scaled to non-powers of two. |
+ // We don't need to test this. We know it doesn't work, and it causes images with |
+ // uninitialized memory to show up on Gold. |
+ if (SkBitmapRegionDecoderInterface::kOriginal_Strategy == strategy && |
+ (path.endsWith(".jpg") || path.endsWith(".JPG") || |
+ path.endsWith(".jpeg") || path.endsWith(".JPEG")) && !SkIsPow2(sampleSize)) { |
+ continue; |
+ } |
+ for (CodecSrc::DstColorType dstColorType : dstColorTypes) { |
+ if (brd_color_type_supported(strategy, dstColorType)) { |
+ for (BRDSrc::Mode mode : modes) { |
push_brd_src(path, strategy, dstColorType, mode, sampleSize); |
} |
} |