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

Unified Diff: dm/DMSrcSink.cpp

Issue 1641663002: Stop testing SkImageDecoder in DM/nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reblacklist some interlaced images 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMSrcSink.h ('k') | tools/dm_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 5b20e3959fbb0dcb95148c088868cc2cd09c8cb6..29886807a7117b412ddce12102d6433e7dc289cd 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -733,56 +733,6 @@ Name AndroidCodecSrc::name() const {
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-ImageSrc::ImageSrc(Path path) : fPath(path) {}
-
-bool ImageSrc::veto(SinkFlags flags) const {
- // No need to test decoding to non-raster or indirect backend.
- // TODO: Instead, use lazy decoding to allow the GPU to handle cases like YUV.
- return flags.type != SinkFlags::kRaster
- || flags.approach != SinkFlags::kDirect;
-}
-
-Error ImageSrc::draw(SkCanvas* canvas) const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- if (!encoded) {
- return SkStringPrintf("Couldn't read %s.", fPath.c_str());
- }
- const SkColorType dstColorType = canvas->imageInfo().colorType();
-
- // Decode the full image.
- SkBitmap bitmap;
- if (!SkImageDecoder::DecodeMemory(encoded->data(), encoded->size(), &bitmap,
- dstColorType, SkImageDecoder::kDecodePixels_Mode)) {
- return SkStringPrintf("Couldn't decode %s.", fPath.c_str());
- }
- if (kRGB_565_SkColorType == dstColorType && !bitmap.isOpaque()) {
- // Do not draw a bitmap with alpha to a destination without alpha.
- return Error::Nonfatal("Uninteresting to decode image with alpha into 565.");
- }
- encoded.reset((SkData*)nullptr); // Might as well drop this when we're done with it.
- canvas->drawBitmap(bitmap, 0,0);
- return "";
-}
-
-SkISize ImageSrc::size() const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkBitmap bitmap;
- if (!encoded || !SkImageDecoder::DecodeMemory(encoded->data(),
- encoded->size(),
- &bitmap,
- kUnknown_SkColorType,
- SkImageDecoder::kDecodeBounds_Mode)) {
- return SkISize::Make(0,0);
- }
- return bitmap.dimensions();
-}
-
-Name ImageSrc::name() const {
- return SkOSPath::Basename(fPath.c_str());
-}
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
static const SkRect kSKPViewport = {0,0, 1000,1000};
SKPSrc::SKPSrc(Path path) : fPath(path) {}
« no previous file with comments | « dm/DMSrcSink.h ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698