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

Unified Diff: dm/DM.cpp

Issue 1313233007: Remove jpegs with uninitialized memory from Gold (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
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 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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698