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

Unified Diff: tests/PictureTest.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up 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
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 98ebf6a01e5e74c1a529c41e91289cc0a8ae5a5b..4b3faaa4c7ae93c2f2703f0687a2b3999eeb2ec0 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -897,7 +897,8 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
{
SkPictureRecorder recorder;
- SkCanvas* c = recorder.DEPRECATED_beginRecording(kWidth, kHeight);
+ SkCanvas* c = recorder.DEPRECATED_beginRecording(SkIntToScalar(kWidth),
+ SkIntToScalar(kHeight));
// 1)
c->saveLayer(NULL, NULL);
c->restore();
@@ -1118,7 +1119,8 @@ private:
void check_save_state(skiatest::Reporter* reporter, SkPicture* picture,
unsigned int numSaves, unsigned int numSaveLayers,
unsigned int numRestores) {
- SaveCountingCanvas canvas(picture->width(), picture->height());
+ SaveCountingCanvas canvas(SkScalarCeilToInt(picture->cullRect().width()),
+ SkScalarCeilToInt(picture->cullRect().height()));
picture->draw(&canvas);
@@ -1374,7 +1376,8 @@ static SkData* encode_bitmap_to_data(size_t*, const SkBitmap& bm) {
static SkData* serialized_picture_from_bitmap(const SkBitmap& bitmap) {
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(bitmap.width(), bitmap.height());
+ SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(bitmap.width()),
+ SkIntToScalar(bitmap.height()));
canvas->drawBitmap(bitmap, 0, 0);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());

Powered by Google App Engine
This is Rietveld 408576698