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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1682973004: Enable ImageGenerator tests on direct raster and direct gpu backends (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comment Created 4 years, 10 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 , fMode(mode) 264 , fMode(mode)
265 , fDstColorType(dstColorType) 265 , fDstColorType(dstColorType)
266 , fDstAlphaType(dstAlphaType) 266 , fDstAlphaType(dstAlphaType)
267 , fScale(scale) 267 , fScale(scale)
268 , fRunSerially(serial_from_path_name(path)) 268 , fRunSerially(serial_from_path_name(path))
269 {} 269 {}
270 270
271 bool CodecSrc::veto(SinkFlags flags) const { 271 bool CodecSrc::veto(SinkFlags flags) const {
272 // Test CodecImageGenerator on 8888, 565, and gpu 272 // Test CodecImageGenerator on 8888, 565, and gpu
273 if (kGen_Mode == fMode) { 273 if (kGen_Mode == fMode) {
274 return flags.type != SinkFlags::kRaster || flags.type != SinkFlags::kGPU || 274 // For image generator, we want to test kDirect approaches for kRaster a nd kGPU,
275 // while skipping everything else.
276 return (flags.type != SinkFlags::kRaster && flags.type != SinkFlags::kGP U) ||
275 flags.approach != SinkFlags::kDirect; 277 flags.approach != SinkFlags::kDirect;
276 } 278 }
277 279
278 // Test all other modes to direct raster backends (8888 and 565). 280 // Test all other modes to direct raster backends (8888 and 565).
279 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir ect; 281 return flags.type != SinkFlags::kRaster || flags.approach != SinkFlags::kDir ect;
280 } 282 }
281 283
282 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s kbug.com/3339. 284 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 and s kbug.com/3339.
283 // This allows us to still test unpremultiplied decodes. 285 // This allows us to still test unpremultiplied decodes.
284 void premultiply_if_necessary(SkBitmap& bitmap) { 286 void premultiply_if_necessary(SkBitmap& bitmap) {
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 skr.visit<void>(i, drawsAsSingletonPictures); 1410 skr.visit<void>(i, drawsAsSingletonPictures);
1409 } 1411 }
1410 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1411 1413
1412 canvas->drawPicture(macroPic); 1414 canvas->drawPicture(macroPic);
1413 return check_against_reference(bitmap, src, fSink); 1415 return check_against_reference(bitmap, src, fSink);
1414 }); 1416 });
1415 } 1417 }
1416 1418
1417 } // namespace DM 1419 } // 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