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

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: Removed additional blacklist items 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 | « dm/DM.cpp ('k') | gyp/codec.gyp » ('j') | no next file with comments »
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return Error::Nonfatal("Incompatible colortype conversion"); 81 return Error::Nonfatal("Incompatible colortype conversion");
82 default: 82 default:
83 // Everything else is considered a failure. 83 // Everything else is considered a failure.
84 return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str()); 84 return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str());
85 } 85 }
86 } 86 }
87 87
88 SkISize CodecSrc::size() const { 88 SkISize CodecSrc::size() const {
89 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str())); 89 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
90 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); 90 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
91 return codec->getInfo().dimensions(); 91 if (NULL != codec) {
92 return codec->getInfo().dimensions();
93 } else {
94 return SkISize::Make(0, 0);
95 }
92 } 96 }
93 97
94 Name CodecSrc::name() const { 98 Name CodecSrc::name() const {
95 return SkOSPath::Basename(fPath.c_str()); 99 return SkOSPath::Basename(fPath.c_str());
96 } 100 }
97 101
98 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 102 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
99 103
100 ImageSrc::ImageSrc(Path path, int divisor) : fPath(path), fDivisor(divisor) {} 104 ImageSrc::ImageSrc(Path path, int divisor) : fPath(path), fDivisor(divisor) {}
101 105
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 surfaces.unrefAll(); 578 surfaces.unrefAll();
575 return ""; 579 return "";
576 } 580 }
577 SkISize size() const SK_OVERRIDE { return fSize; } 581 SkISize size() const SK_OVERRIDE { return fSize; }
578 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 582 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
579 } proxy(fW, fH, pic, src.size()); 583 } proxy(fW, fH, pic, src.size());
580 return fSink->draw(proxy, bitmap, stream, log); 584 return fSink->draw(proxy, bitmap, stream, log);
581 } 585 }
582 586
583 } // namespace DM 587 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | gyp/codec.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698