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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1635453002: Do not test images with alpha to 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SkAndroidCodec.h" 9 #include "SkAndroidCodec.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 Error test_gen(SkCanvas* canvas, SkData* data) { 281 Error test_gen(SkCanvas* canvas, SkData* data) {
282 SkImageGenerator* gen = SkCodecImageGenerator::NewFromEncodedCodec(data); 282 SkImageGenerator* gen = SkCodecImageGenerator::NewFromEncodedCodec(data);
283 if (!gen) { 283 if (!gen) {
284 return "Could not create image generator."; 284 return "Could not create image generator.";
285 } 285 }
286 286
287 // FIXME: The gpu backend does not draw kGray sources correctly. (skbug.com/ 4822) 287 // FIXME: The gpu backend does not draw kGray sources correctly. (skbug.com/ 4822)
288 // Currently, we will avoid creating a CodecSrc for this case (see DM.cpp). 288 // Currently, we will avoid creating a CodecSrc for this case (see DM.cpp).
289 SkASSERT(kGray_8_SkColorType != gen->getInfo().colorType()); 289 SkASSERT(kGray_8_SkColorType != gen->getInfo().colorType());
290 290
291 if (kOpaque_SkAlphaType != gen->getInfo().alphaType() &&
292 kRGB_565_SkColorType == canvas->imageInfo().colorType()) {
293 return Error::Nonfatal("Skip testing non-opaque images to 565.");
294 }
295
291 SkAutoTDelete<SkImage> image(SkImage::NewFromGenerator(gen, nullptr)); 296 SkAutoTDelete<SkImage> image(SkImage::NewFromGenerator(gen, nullptr));
292 if (!image) { 297 if (!image) {
293 return "Could not create image from codec image generator."; 298 return "Could not create image from codec image generator.";
294 } 299 }
295 300
296 canvas->drawImage(image, 0, 0); 301 canvas->drawImage(image, 0, 0);
297 return ""; 302 return "";
298 } 303 }
299 304
300 Error CodecSrc::draw(SkCanvas* canvas) const { 305 Error CodecSrc::draw(SkCanvas* canvas) const {
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 skr.visit<void>(i, drawsAsSingletonPictures); 1345 skr.visit<void>(i, drawsAsSingletonPictures);
1341 } 1346 }
1342 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1347 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1343 1348
1344 canvas->drawPicture(macroPic); 1349 canvas->drawPicture(macroPic);
1345 return check_against_reference(bitmap, src, fSink); 1350 return check_against_reference(bitmap, src, fSink);
1346 }); 1351 });
1347 } 1352 }
1348 1353
1349 } // namespace DM 1354 } // namespace DM
OLDNEW
« 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