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

Unified Diff: samplecode/SamplePictFile.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkBBoxRecord.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePictFile.cpp
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index 87a0e67136148692a2c602ab2ad934021df09932..3d7acfc47de3ae2422dd51794067ccb646068c32 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -123,7 +123,9 @@ private:
if (SkImageDecoder::DecodeFile(path, &bm)) {
bm.setImmutable();
SkPictureRecorder recorder;
- SkCanvas* can = recorder.beginRecording(bm.width(), bm.height(), NULL, 0);
+ SkCanvas* can = recorder.beginRecording(SkIntToScalar(bm.width()),
+ SkIntToScalar(bm.height()),
+ NULL, 0);
can->drawBitmap(bm, 0, 0, NULL);
pic.reset(recorder.endRecording());
} else {
@@ -135,13 +137,16 @@ private:
}
if (false) {
- SkSurface* surf = SkSurface::NewRasterPMColor(pic->width(), pic->height());
+ SkSurface* surf = SkSurface::NewRasterPMColor(SkScalarCeilToInt(pic->cullRect().width()),
+ SkScalarCeilToInt(pic->cullRect().height()));
surf->getCanvas()->drawPicture(pic);
surf->unref();
}
if (false) { // re-record
SkPictureRecorder recorder;
- pic->draw(recorder.beginRecording(pic->width(), pic->height(), NULL, 0));
+ pic->draw(recorder.beginRecording(pic->cullRect().width(),
+ pic->cullRect().height(),
+ NULL, 0));
SkAutoTUnref<SkPicture> p2(recorder.endRecording());
SkString path2(path);
@@ -177,7 +182,9 @@ private:
}
SkPictureRecorder recorder;
- pic->draw(recorder.beginRecording(pic->width(), pic->height(), factory.get(), 0));
+ pic->draw(recorder.beginRecording(pic->cullRect().width(),
+ pic->cullRect().height(),
+ factory.get(), 0));
return recorder.endRecording();
}
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkBBoxRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698