Implement onDrawDrawable in SkDebugCanvas
It now implements all canvas virtuals, so enable the enforcer.
Change-Id: Ic7e97e29ec143f72cd0ea6c6504345133b8f543e
Reviewed-on: https://skia-review.googlesource.com/130560
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 2153286..743a8d7 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -12,6 +12,7 @@
#include "SkAutoMalloc.h"
#include "SkColorFilter.h"
#include "SkDashPathEffect.h"
+#include "SkDrawable.h"
#include "SkImageFilter.h"
#include "SkJsonWriteBuffer.h"
#include "SkMaskFilterBase.h"
@@ -247,6 +248,7 @@
case kDrawTextRSXform_OpType: return "DrawTextRSXform";
case kDrawVertices_OpType: return "DrawVertices";
case kDrawAtlas_OpType: return "DrawAtlas";
+ case kDrawDrawable_OpType: return "DrawDrawable";
case kEndDrawPicture_OpType: return "EndDrawPicture";
case kRestore_OpType: return "Restore";
case kSave_OpType: return "Save";
@@ -2140,6 +2142,19 @@
return result;
}
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+SkDrawDrawableCommand::SkDrawDrawableCommand(SkDrawable* drawable, const SkMatrix* matrix)
+ : INHERITED(kDrawDrawable_OpType)
+ , fDrawable(SkRef(drawable))
+ , fMatrix(matrix) {}
+
+void SkDrawDrawableCommand::execute(SkCanvas* canvas) const {
+ canvas->drawDrawable(fDrawable.get(), fMatrix.getMaybeNull());
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
SkDrawTextCommand::SkDrawTextCommand(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint)
: INHERITED(kDrawText_OpType)