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

Unified Diff: third_party/WebKit/Source/platform/testing/PictureMatchers.cpp

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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: 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));
}

Powered by Google App Engine
This is Rietveld 408576698