aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/debugger/SkDebugCanvas.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-03-12 10:57:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-13 01:35:26 +0000
commitc25e2693ab00cfe7691b68b7d47f2159640d783a (patch)
treef65360813b15781f9961c2cd227365c1025dfc2f /tools/debugger/SkDebugCanvas.cpp
parent8103ecae7b535f011f89b03545fe768801027b6b (diff)
Fix several bugs in SkDebugCanvas/SkDrawCommand
This adds drawImageNine and drawRegion support, actually serializes regions (badly) for clipRegion, and fixes bugs in quite a few other draw commands (wrong op type, missing factory registration, JSON attribute mismatch, etc...) There are still some other draw virtuals missing, but even getting Lattice to round-trip through JSON is going to be a bunch of new code, and I didn't want to combine too much new code with the fixes for existing bugs. Change-Id: I13749a2d21f4a5ca5f5948b60fc11185bc46645f Reviewed-on: https://skia-review.googlesource.com/113707 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/debugger/SkDebugCanvas.cpp')
-rw-r--r--tools/debugger/SkDebugCanvas.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index d2dddb8d15..8644025c48 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -509,6 +509,11 @@ void SkDebugCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, con
this->addDrawCommand(new SkDrawImageRectCommand(image, src, dst, paint, constraint));
}
+void SkDebugCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center,
+ const SkRect& dst, const SkPaint* paint) {
+ this->addDrawCommand(new SkDrawImageNineCommand(image, center, dst, paint));
+}
+
void SkDebugCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
this->addDrawCommand(new SkDrawOvalCommand(oval, paint));
}
@@ -526,6 +531,10 @@ void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
this->addDrawCommand(new SkDrawPathCommand(path, paint));
}
+void SkDebugCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) {
+ this->addDrawCommand(new SkDrawRegionCommand(region, paint));
+}
+
void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
const SkMatrix* matrix,
const SkPaint* paint) {