aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/debugger/SkDrawCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debugger/SkDrawCommand.cpp')
-rw-r--r--tools/debugger/SkDrawCommand.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 215328603f..743a8d7920 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 @@ const char* SkDrawCommand::GetCommandString(OpType type) {
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 @@ Json::Value SkDrawShadowCommand::toJSON(UrlDataManager& urlDataManager) const {
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)