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

Unified Diff: tests/PictureTest.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 | « tests/PathOpsSkpClipTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 627e96e20f6d8d471bb214678dceb96245183f7e..8b19df21616f3fcf5ab60a045382ec8c6e0dea0e 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -882,7 +882,7 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
{
SkPictureRecorder recorder;
- SkCanvas* c = recorder.beginRecording(kWidth, kHeight);
+ SkCanvas* c = recorder.beginRecording(SkIntToScalar(kWidth), SkIntToScalar(kHeight));
c->saveLayer(NULL, NULL);
c->restore();
@@ -914,7 +914,8 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
{
SkPictureRecorder recorder;
- SkCanvas* c = recorder.beginRecording(kWidth, kHeight);
+ SkCanvas* c = recorder.beginRecording(SkIntToScalar(kWidth),
+ SkIntToScalar(kHeight));
// 1)
c->saveLayer(NULL, NULL); // layer #0
c->restore();
@@ -1187,7 +1188,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);
@@ -1443,7 +1445,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());
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698