aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-03-16 11:07:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-16 11:07:02 -0700
commitdfdec78a5d02e8690998741a9fe5b71a08ca3232 (patch)
tree477847bdf2341f6d2d20d40c973f569b7b880c39 /dm
parentd18475854ce232de71c5463e0654f459d4abfd43 (diff)
Revert "Implementation of image decoding for bmp files, in accordance with the new API."
This reverts commit 3675874468de7228944ce21922e6ec863f5f2310. BUG=skia: NOTREECHECKS=true NOTRY=true TBR= Review URL: https://codereview.chromium.org/1012873002
Diffstat (limited to 'dm')
-rw-r--r--dm/DMSrcSink.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 6f6664f27c..91f4e238c2 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -141,27 +141,15 @@ Error ImageSrc::draw(SkCanvas* canvas) const {
SkISize ImageSrc::size() const {
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- if (FLAGS_codec) {
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
- if (!codec) {
- return SkISize::Make(0,0);
- }
- SkImageInfo info;
- if (!codec->getInfo(&info)) {
- return SkISize::Make(0,0);
- }
- return info.dimensions();
- } else {
- SkBitmap bitmap;
- if (!encoded || !SkImageDecoder::DecodeMemory(encoded->data(),
- encoded->size(),
- &bitmap,
- kUnknown_SkColorType,
- SkImageDecoder::kDecodeBounds_Mode)) {
- return SkISize::Make(0,0);
- }
- return bitmap.dimensions();
+ 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 {