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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 947283002: Bmp Image Decoding (Closed) Base URL: https://skia.googlesource.com/skia.git@decode-leon-3
Patch Set: Tested bmp and swizzler design Created 5 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 | gyp/codec.gyp » ('j') | include/codec/SkCodec.h » ('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 "SkMultiPictureDraw.h" 6 #include "SkMultiPictureDraw.h"
7 #include "SkNullCanvas.h" 7 #include "SkNullCanvas.h"
8 #include "SkOSFile.h" 8 #include "SkOSFile.h"
9 #include "SkPictureRecorder.h" 9 #include "SkPictureRecorder.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 30 matching lines...) Expand all
41 41
42 Error ImageSrc::draw(SkCanvas* canvas) const { 42 Error ImageSrc::draw(SkCanvas* canvas) const {
43 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str())); 43 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
44 if (!encoded) { 44 if (!encoded) {
45 return SkStringPrintf("Couldn't read %s.", fPath.c_str()); 45 return SkStringPrintf("Couldn't read %s.", fPath.c_str());
46 } 46 }
47 const SkColorType dstColorType = canvas->imageInfo().colorType(); 47 const SkColorType dstColorType = canvas->imageInfo().colorType();
48 if (fDivisor == 0) { 48 if (fDivisor == 0) {
49 // Just for debugging. 49 // Just for debugging.
50 SkString name = SkOSPath::Basename(fPath.c_str()); 50 SkString name = SkOSPath::Basename(fPath.c_str());
51 SkDebugf("Attempting to decode %s\n", name.c_str()); 51 SkDebugf("\nAttempting to decode %s\n", name.c_str());
52 // Decode the full image. 52 // Decode the full image.
53 SkBitmap bitmap; 53 SkBitmap bitmap;
54 if (FLAGS_codec) { 54 if (FLAGS_codec) {
55 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); 55 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
56 if (!codec) { 56 if (!codec) {
57 return SkStringPrintf("Couldn't decode %s.", fPath.c_str()); 57 return SkStringPrintf("Couldn't decode %s.", fPath.c_str());
58 } 58 }
59 SkImageInfo info; 59 SkImageInfo info;
60 if (!codec->getInfo(&info)) { 60 if (!codec->getInfo(&info)) {
61 return SkStringPrintf("Couldn't getInfo %s.", fPath.c_str()); 61 return SkStringPrintf("Couldn't getInfo %s.", fPath.c_str());
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 surfaces.unrefAll(); 482 surfaces.unrefAll();
483 return ""; 483 return "";
484 } 484 }
485 SkISize size() const SK_OVERRIDE { return fSize; } 485 SkISize size() const SK_OVERRIDE { return fSize; }
486 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 486 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
487 } proxy(fW, fH, pic, src.size()); 487 } proxy(fW, fH, pic, src.size());
488 return fSink->draw(proxy, bitmap, stream, log); 488 return fSink->draw(proxy, bitmap, stream, log);
489 } 489 }
490 490
491 } // namespace DM 491 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | gyp/codec.gyp » ('j') | include/codec/SkCodec.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698