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

Unified Diff: src/utils/debugger/SkDrawCommand.h

Issue 1253473002: Add drawImage{Rect,} support to SkDebugCanvas (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: win warnings Created 5 years, 5 months 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
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDrawCommand.h
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index 99e3eea457530f93112aa615b9a66ba1472a8741..7ff5a86bd33bc061fa31c9be325224d88bc13cfe 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -26,6 +26,8 @@ public:
kDrawBitmapRect_OpType,
kDrawClear_OpType,
kDrawDRRect_OpType,
+ kDrawImage_OpType,
+ kDrawImageRect_OpType,
kDrawOval_OpType,
kDrawPaint_OpType,
kDrawPatch_OpType,
@@ -264,6 +266,36 @@ private:
typedef SkDrawCommand INHERITED;
};
+class SkDrawImageCommand : public SkDrawCommand {
+public:
+ SkDrawImageCommand(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint);
+ void execute(SkCanvas* canvas) const override;
+ bool render(SkCanvas* canvas) const override;
+private:
+ SkAutoTUnref<const SkImage> fImage;
+ SkScalar fLeft;
+ SkScalar fTop;
+ SkTLazy<SkPaint> fPaint;
+
+ typedef SkDrawCommand INHERITED;
+};
+
+class SkDrawImageRectCommand : public SkDrawCommand {
+public:
+ SkDrawImageRectCommand(const SkImage* image, const SkRect* src, const SkRect& dst,
+ const SkPaint* paint, SkCanvas::SrcRectConstraint constraint);
+ void execute(SkCanvas* canvas) const override;
+ bool render(SkCanvas* canvas) const override;
+private:
+ SkAutoTUnref<const SkImage> fImage;
+ SkTLazy<SkRect> fSrc;
+ SkRect fDst;
+ SkTLazy<SkPaint> fPaint;
+ SkCanvas::SrcRectConstraint fConstraint;
+
+ typedef SkDrawCommand INHERITED;
+};
+
class SkDrawOvalCommand : public SkDrawCommand {
public:
SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint);
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698