Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 Error SKPSrc::draw(SkCanvas* canvas) const { | 194 Error SKPSrc::draw(SkCanvas* canvas) const { |
| 195 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); | 195 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); |
| 196 if (!stream) { | 196 if (!stream) { |
| 197 return SkStringPrintf("Couldn't read %s.", fPath.c_str()); | 197 return SkStringPrintf("Couldn't read %s.", fPath.c_str()); |
| 198 } | 198 } |
| 199 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream)); | 199 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream)); |
| 200 if (!pic) { | 200 if (!pic) { |
| 201 return SkStringPrintf("Couldn't decode %s as a picture.", fPath.c_str()) ; | 201 return SkStringPrintf("Couldn't decode %s as a picture.", fPath.c_str()) ; |
| 202 } | 202 } |
| 203 stream.reset((SkStream*)NULL); // Might as well drop this when we're done w ith it. | 203 stream.reset((SkStream*)NULL); // Might as well drop this when we're done w ith it. |
| 204 | |
| 204 canvas->clipRect(kSKPViewport); | 205 canvas->clipRect(kSKPViewport); |
|
robertphillips
2015/03/23 19:03:11
check in disabled ?
// Testing TextBlob batching r
joshualitt
2015/03/23 19:56:08
Acknowledged.
| |
| 206 #define DOUBLE_LOOP | |
| 207 #ifdef DOUBLE_LOOP | |
| 208 { | |
| 209 SkAutoCanvasRestore acr(canvas, true); | |
| 210 #endif | |
| 211 canvas->drawPicture(pic); | |
| 212 #ifdef DOUBLE_LOOP | |
| 213 } | |
| 214 canvas->clear(0); | |
| 205 canvas->drawPicture(pic); | 215 canvas->drawPicture(pic); |
| 216 #endif | |
| 206 return ""; | 217 return ""; |
| 207 } | 218 } |
| 208 | 219 |
| 209 SkISize SKPSrc::size() const { | 220 SkISize SKPSrc::size() const { |
| 210 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); | 221 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); |
| 211 if (!stream) { | 222 if (!stream) { |
| 212 return SkISize::Make(0,0); | 223 return SkISize::Make(0,0); |
| 213 } | 224 } |
| 214 SkPictInfo info; | 225 SkPictInfo info; |
| 215 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) { | 226 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) { |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 574 surfaces.unrefAll(); | 585 surfaces.unrefAll(); |
| 575 return ""; | 586 return ""; |
| 576 } | 587 } |
| 577 SkISize size() const SK_OVERRIDE { return fSize; } | 588 SkISize size() const SK_OVERRIDE { return fSize; } |
| 578 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. | 589 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. |
| 579 } proxy(fW, fH, pic, src.size()); | 590 } proxy(fW, fH, pic, src.size()); |
| 580 return fSink->draw(proxy, bitmap, stream, log); | 591 return fSink->draw(proxy, bitmap, stream, log); |
| 581 } | 592 } |
| 582 | 593 |
| 583 } // namespace DM | 594 } // namespace DM |
| OLD | NEW |