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

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: feedback inc 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/GrAtlas.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
207 // TODO remove this and add a flag to DM so we can run skps multiple times
208 //#define DOUBLE_LOOP
209 #ifdef DOUBLE_LOOP
210 {
211 SkAutoCanvasRestore acr(canvas, true);
212 #endif
213 canvas->drawPicture(pic);
214 #ifdef DOUBLE_LOOP
215 }
216 canvas->clear(0);
205 canvas->drawPicture(pic); 217 canvas->drawPicture(pic);
218 #endif
206 return ""; 219 return "";
207 } 220 }
208 221
209 SkISize SKPSrc::size() const { 222 SkISize SKPSrc::size() const {
210 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str())); 223 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(fPath.c_str()));
211 if (!stream) { 224 if (!stream) {
212 return SkISize::Make(0,0); 225 return SkISize::Make(0,0);
213 } 226 }
214 SkPictInfo info; 227 SkPictInfo info;
215 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) { 228 if (!SkPicture::InternalOnly_StreamIsSKP(stream, &info)) {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 surfaces.unrefAll(); 587 surfaces.unrefAll();
575 return ""; 588 return "";
576 } 589 }
577 SkISize size() const SK_OVERRIDE { return fSize; } 590 SkISize size() const SK_OVERRIDE { return fSize; }
578 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 591 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
579 } proxy(fW, fH, pic, src.size()); 592 } proxy(fW, fH, pic, src.size());
580 return fSink->draw(proxy, bitmap, stream, log); 593 return fSink->draw(proxy, bitmap, stream, log);
581 } 594 }
582 595
583 } // namespace DM 596 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | src/gpu/GrAtlas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698