| Index: third_party/WebKit/Source/platform/testing/PictureMatchers.cpp
|
| diff --git a/third_party/WebKit/Source/platform/testing/PictureMatchers.cpp b/third_party/WebKit/Source/platform/testing/PictureMatchers.cpp
|
| index 1324f7bac63bc61bf23d0f7f7c59562c5a8fd855..9cc4de082dc1857c34405053acace164d6870b16 100644
|
| --- a/third_party/WebKit/Source/platform/testing/PictureMatchers.cpp
|
| +++ b/third_party/WebKit/Source/platform/testing/PictureMatchers.cpp
|
| @@ -7,7 +7,9 @@
|
| #include "platform/geometry/FloatQuad.h"
|
| #include "platform/geometry/FloatRect.h"
|
| #include "third_party/skia/include/core/SkCanvas.h"
|
| -#include "third_party/skia/include/core/SkPicture.h"
|
| +#include "skia/ext/cdl_canvas.h"
|
| +#include "skia/ext/cdl_paint.h"
|
| +#include "skia/ext/cdl_picture.h"
|
| #include "wtf/Vector.h"
|
| #include "wtf/text/WTFString.h"
|
| #include <utility>
|
| @@ -16,16 +18,16 @@ namespace blink {
|
|
|
| namespace {
|
|
|
| -class DrawsRectangleCanvas : public SkCanvas {
|
| +class DrawsRectangleCanvas : public CdlCanvas {
|
| public:
|
| - DrawsRectangleCanvas() : SkCanvas(800, 600) {}
|
| + DrawsRectangleCanvas() : CdlCanvas(800, 600) {}
|
| const Vector<std::pair<FloatQuad, Color>>& quads() const { return m_quads; }
|
| - void onDrawRect(const SkRect& rect, const SkPaint& paint) override {
|
| + void onDrawRect(const SkRect& rect, const CdlPaint& paint) override {
|
| SkPoint quad[4];
|
| getTotalMatrix().mapRectToQuad(quad, rect);
|
| FloatQuad floatQuad(quad);
|
| m_quads.append(std::make_pair(floatQuad, Color(paint.getColor())));
|
| - SkCanvas::onDrawRect(rect, paint);
|
| + CdlCanvas::onDrawRect(rect, paint);
|
| }
|
|
|
| private:
|
| @@ -33,13 +35,13 @@ class DrawsRectangleCanvas : public SkCanvas {
|
| };
|
|
|
| class DrawsRectangleMatcher
|
| - : public ::testing::MatcherInterface<const SkPicture&> {
|
| + : public ::testing::MatcherInterface<const CdlPicture&> {
|
| public:
|
| DrawsRectangleMatcher(const FloatRect& rect, Color color)
|
| : m_rect(rect), m_color(color) {}
|
|
|
| bool MatchAndExplain(
|
| - const SkPicture& picture,
|
| + const CdlPicture& picture,
|
| ::testing::MatchResultListener* listener) const override {
|
| DrawsRectangleCanvas canvas;
|
| picture.playback(&canvas);
|
| @@ -88,8 +90,8 @@ class DrawsRectangleMatcher
|
|
|
| } // namespace
|
|
|
| -::testing::Matcher<const SkPicture&> drawsRectangle(const FloatRect& rect,
|
| - Color color) {
|
| +::testing::Matcher<const CdlPicture&> drawsRectangle(const FloatRect& rect,
|
| + Color color) {
|
| return ::testing::MakeMatcher(new DrawsRectangleMatcher(rect, color));
|
| }
|
|
|
|
|