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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1011343003: Enabling ico decoding with use of png and bmp decoders (Closed) Base URL: https://skia.googlesource.com/skia.git@swizzle
Patch Set: Provide the user with an option of which ico to decode Created 5 years, 9 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 | gyp/codec.gyp » ('j') | src/codec/SkCodec_libico.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMSrcSink.h" 1 #include "DMSrcSink.h"
2 #include "SamplePipeControllers.h" 2 #include "SamplePipeControllers.h"
3 #include "SkCommonFlags.h" 3 #include "SkCommonFlags.h"
4 #include "SkCodec.h" 4 #include "SkCodec.h"
5 #include "SkDocument.h" 5 #include "SkDocument.h"
6 #include "SkError.h" 6 #include "SkError.h"
7 #include "SkMultiPictureDraw.h" 7 #include "SkMultiPictureDraw.h"
8 #include "SkNullCanvas.h" 8 #include "SkNullCanvas.h"
9 #include "SkOSFile.h" 9 #include "SkOSFile.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return Error::Nonfatal("Uninteresting to decode image with alpha into 565."); 134 return Error::Nonfatal("Uninteresting to decode image with alpha into 565.");
135 } 135 }
136 canvas->drawBitmap(subset, SkIntToScalar(x), SkIntToScalar(y)); 136 canvas->drawBitmap(subset, SkIntToScalar(x), SkIntToScalar(y));
137 } 137 }
138 } 138 }
139 return ""; 139 return "";
140 } 140 }
141 141
142 SkISize ImageSrc::size() const { 142 SkISize ImageSrc::size() const {
143 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str())); 143 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
144 SkDebugf("\n%s\n", fPath.c_str());
msarett 2015/03/20 18:35:57 Ignore this. I will remove.
144 if (FLAGS_codec) { 145 if (FLAGS_codec) {
145 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); 146 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
146 if (!codec) { 147 if (!codec) {
147 return SkISize::Make(0,0); 148 return SkISize::Make(0,0);
148 } 149 }
149 SkImageInfo info; 150 SkImageInfo info;
150 if (!codec->getInfo(&info)) { 151 if (!codec->getInfo(&info)) {
151 return SkISize::Make(0,0); 152 return SkISize::Make(0,0);
152 } 153 }
153 return info.dimensions(); 154 return info.dimensions();
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 surfaces.unrefAll(); 558 surfaces.unrefAll();
558 return ""; 559 return "";
559 } 560 }
560 SkISize size() const SK_OVERRIDE { return fSize; } 561 SkISize size() const SK_OVERRIDE { return fSize; }
561 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 562 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
562 } proxy(fW, fH, pic, src.size()); 563 } proxy(fW, fH, pic, src.size());
563 return fSink->draw(proxy, bitmap, stream, log); 564 return fSink->draw(proxy, bitmap, stream, log);
564 } 565 }
565 566
566 } // namespace DM 567 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | gyp/codec.gyp » ('j') | src/codec/SkCodec_libico.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698