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(); |
} |