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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1011403004: BitmapTextBatch and BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@dfpr_take_2
Patch Set: tidying 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/gpu.gypi » ('j') | src/gpu/GrBatchAtlas.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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
206 // Testing TextBlob batching requires that we see individual text blobs more than once
bsalomon 2015/03/26 17:06:55 revert before landing?
joshualitt 2015/03/26 18:21:43 I'll fix this when I land the better fix to DM. I
207 //#define DOUBLE_LOOP
208 #ifdef DOUBLE_LOOP
209 {
210 SkAutoCanvasRestore acr(canvas, true);
211 #endif
212 canvas->drawPicture(pic);
213 #ifdef DOUBLE_LOOP
214 }
215 canvas->clear(0);
205 canvas->drawPicture(pic); 216 canvas->drawPicture(pic);
217 #endif
206 return ""; 218 return "";
207 } 219 }
208 220
209 SkISize SKPSrc::size() const { 221 SkISize SKPSrc::size() const {
210 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); 222 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str()));
211 if (!stream) { 223 if (!stream) {
212 return SkISize::Make(0,0); 224 return SkISize::Make(0,0);
213 } 225 }
214 SkPictInfo info; 226 SkPictInfo info;
215 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) { 227 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 surfaces.unrefAll(); 586 surfaces.unrefAll();
575 return ""; 587 return "";
576 } 588 }
577 SkISize size() const SK_OVERRIDE { return fSize; } 589 SkISize size() const SK_OVERRIDE { return fSize; }
578 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 590 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
579 } proxy(fW, fH, pic, src.size()); 591 } proxy(fW, fH, pic, src.size());
580 return fSink->draw(proxy, bitmap, stream, log); 592 return fSink->draw(proxy, bitmap, stream, log);
581 } 593 }
582 594
583 } // namespace DM 595 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | src/gpu/GrBatchAtlas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698