| Index: skia/ext/platform_canvas_unittest.cc
|
| diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc
|
| index 57b37f8d891f263ee950d7ce247dadc6c7f6e2c8..e0f898125c113e1bd41e72aceb96cb23e6893967 100644
|
| --- a/skia/ext/platform_canvas_unittest.cc
|
| +++ b/skia/ext/platform_canvas_unittest.cc
|
| @@ -14,6 +14,7 @@
|
| #include "skia/ext/platform_device.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| +#include "third_party/skia/include/core/SkCanvas.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| #include "third_party/skia/include/core/SkColorPriv.h"
|
| #include "third_party/skia/include/core/SkPixelRef.h"
|
| @@ -41,10 +42,10 @@ bool IsOfColor(const SkBitmap& bitmap, int x, int y, uint32_t color) {
|
| // rectangle filled to rect_color. This function ignores the alpha channel,
|
| // since Windows will sometimes clear the alpha channel when drawing, and we
|
| // will fix that up later in cases it's necessary.
|
| -bool VerifyRect(const PlatformCanvas& canvas,
|
| +bool VerifyRect(const SkCanvas& canvas,
|
| uint32_t canvas_color, uint32_t rect_color,
|
| int x, int y, int w, int h) {
|
| - const SkBitmap bitmap = skia::ReadPixels(const_cast<PlatformCanvas*>(&canvas));
|
| + const SkBitmap bitmap = skia::ReadPixels(const_cast<SkCanvas*>(&canvas));
|
| SkAutoLockPixels lock(bitmap);
|
|
|
| for (int cur_y = 0; cur_y < bitmap.height(); cur_y++) {
|
| @@ -68,7 +69,7 @@ bool VerifyRect(const PlatformCanvas& canvas,
|
| // Return true if canvas has something that passes for a rounded-corner
|
| // rectangle. Basically, we're just checking to make sure that the pixels in the
|
| // middle are of rect_color and pixels in the corners are of canvas_color.
|
| -bool VerifyRoundedRect(const PlatformCanvas& canvas,
|
| +bool VerifyRoundedRect(const SkCanvas& canvas,
|
| uint32_t canvas_color,
|
| uint32_t rect_color,
|
| int x,
|
| @@ -97,19 +98,19 @@ bool VerifyRoundedRect(const PlatformCanvas& canvas,
|
|
|
| // Checks whether there is a white canvas with a black square at the given
|
| // location in pixels (not in the canvas coordinate system).
|
| -bool VerifyBlackRect(const PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| +bool VerifyBlackRect(const SkCanvas& canvas, int x, int y, int w, int h) {
|
| return VerifyRect(canvas, SK_ColorWHITE, SK_ColorBLACK, x, y, w, h);
|
| }
|
|
|
| #if !defined(USE_AURA) // http://crbug.com/154358
|
| // Check that every pixel in the canvas is a single color.
|
| -bool VerifyCanvasColor(const PlatformCanvas& canvas, uint32_t canvas_color) {
|
| +bool VerifyCanvasColor(const SkCanvas& canvas, uint32_t canvas_color) {
|
| return VerifyRect(canvas, canvas_color, 0, 0, 0, 0, 0);
|
| }
|
| #endif // !defined(USE_AURA)
|
|
|
| #if defined(OS_WIN)
|
| -void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| +void DrawNativeRect(SkCanvas& canvas, int x, int y, int w, int h) {
|
| skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
|
| HDC dc = scoped_platform_paint.GetPlatformSurface();
|
|
|
| @@ -121,7 +122,7 @@ void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| FillRect(dc, &inner_rc, reinterpret_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)));
|
| }
|
| #elif defined(OS_MACOSX)
|
| -void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| +void DrawNativeRect(SkCanvas& canvas, int x, int y, int w, int h) {
|
| skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
|
| CGContextRef context = scoped_platform_paint.GetPlatformSurface();
|
|
|
| @@ -133,14 +134,14 @@ void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| CGContextFillRect(context, inner_rc);
|
| }
|
| #else
|
| -void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| +void DrawNativeRect(SkCanvas& canvas, int x, int y, int w, int h) {
|
| NOTIMPLEMENTED();
|
| }
|
| #endif
|
|
|
| // Clips the contents of the canvas to the given rectangle. This will be
|
| // intersected with any existing clip.
|
| -void AddClip(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
| +void AddClip(SkCanvas& canvas, int x, int y, int w, int h) {
|
| SkRect rect;
|
| rect.set(SkIntToScalar(x), SkIntToScalar(y),
|
| SkIntToScalar(x + w), SkIntToScalar(y + h));
|
| @@ -149,7 +150,7 @@ void AddClip(PlatformCanvas& canvas, int x, int y, int w, int h) {
|
|
|
| class LayerSaver {
|
| public:
|
| - LayerSaver(PlatformCanvas& canvas, int x, int y, int w, int h)
|
| + LayerSaver(SkCanvas& canvas, int x, int y, int w, int h)
|
| : canvas_(canvas),
|
| x_(x),
|
| y_(y),
|
| @@ -176,7 +177,7 @@ class LayerSaver {
|
| int bottom() const { return y_ + h_; }
|
|
|
| private:
|
| - PlatformCanvas& canvas_;
|
| + SkCanvas& canvas_;
|
| int x_, y_, w_, h_;
|
| };
|
|
|
|
|