| Index: skia/ext/vector_canvas_unittest.cc
|
| ===================================================================
|
| --- skia/ext/vector_canvas_unittest.cc (revision 86628)
|
| +++ skia/ext/vector_canvas_unittest.cc (working copy)
|
| @@ -96,11 +96,10 @@
|
| }
|
|
|
| // Loads the image from a canvas.
|
| - Image(skia::PlatformCanvas& canvas) : ignore_alpha_(true) {
|
| + Image(const skia::PlatformCanvas& canvas) : ignore_alpha_(true) {
|
| // Use a different way to access the bitmap. The normal way would be to
|
| // query the SkBitmap.
|
| - skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
|
| - HDC context = scoped_platform_paint.GetPlatformSurface();
|
| + HDC context = canvas.beginPlatformPaint();
|
| HGDIOBJ bitmap = GetCurrentObject(context, OBJ_BITMAP);
|
| EXPECT_TRUE(bitmap != NULL);
|
| // Initialize the clip region to the entire bitmap.
|
| @@ -112,6 +111,7 @@
|
| size_t size = row_length_ * height_;
|
| data_.resize(size);
|
| memcpy(&*data_.begin(), bitmap_data.bmBits, size);
|
| + canvas.endPlatformPaint();
|
| }
|
|
|
| // Loads the image from a canvas.
|
| @@ -267,7 +267,7 @@
|
| // kGenerating value. Returns 0 on success or any positive value between ]0,
|
| // 100] on failure. The return value is the percentage of difference between
|
| // the image in the file and the image in the canvas.
|
| - double ProcessCanvas(skia::PlatformCanvas& canvas,
|
| + double ProcessCanvas(const skia::PlatformCanvas& canvas,
|
| FilePath::StringType filename) const {
|
| filename = filename + FILE_PATH_LITERAL(".png");
|
| switch (action_) {
|
| @@ -286,7 +286,7 @@
|
|
|
| // Compares the bitmap currently loaded in the context with the file. Returns
|
| // the percentage of pixel difference between both images, between 0 and 100.
|
| - double CompareImage(skia::PlatformCanvas& canvas,
|
| + double CompareImage(const skia::PlatformCanvas& canvas,
|
| const FilePath::StringType& filename) const {
|
| Image image1(canvas);
|
| Image image2(test_file(filename));
|
| @@ -295,7 +295,7 @@
|
| }
|
|
|
| // Saves the bitmap currently loaded in the context into the file.
|
| - void SaveImage(skia::PlatformCanvas& canvas,
|
| + void SaveImage(const skia::PlatformCanvas& canvas,
|
| const FilePath::StringType& filename) const {
|
| Image(canvas).SaveToFile(test_file(filename));
|
| }
|
|
|