aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/debugger')
-rw-r--r--src/utils/debugger/SkDebugCanvas.cpp10
-rw-r--r--src/utils/debugger/SkDebugCanvas.h3
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp8
-rw-r--r--src/utils/debugger/SkDrawCommand.h21
4 files changed, 27 insertions, 15 deletions
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 0e07084e43..dae5f331e7 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -276,17 +276,19 @@ bool SkDebugCanvas::concat(const SkMatrix& matrix) {
}
void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left,
- SkScalar top, const SkPaint* paint = NULL) {
+ SkScalar top, const SkPaint* paint = NULL) {
addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint));
}
void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
- const SkRect* src, const SkRect& dst, const SkPaint* paint) {
- addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint));
+ const SkRect* src, const SkRect& dst,
+ const SkPaint* paint,
+ SkCanvas::DrawBitmapRectFlags flags) {
+ addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, flags));
}
void SkDebugCanvas::drawBitmapMatrix(const SkBitmap& bitmap,
- const SkMatrix& matrix, const SkPaint* paint) {
+ const SkMatrix& matrix, const SkPaint* paint) {
addDrawCommand(new SkDrawBitmapMatrixCommand(bitmap, matrix, paint));
}
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index 5fb99aa895..705f49af83 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -161,7 +161,8 @@ public:
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
- const SkRect& dst, const SkPaint*) SK_OVERRIDE;
+ const SkRect& dst, const SkPaint* paint,
+ DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&,
const SkPaint*) SK_OVERRIDE;
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index ad66c8dc4e..1d4bfed7f3 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -342,7 +342,8 @@ bool SkDrawBitmapNineCommand::render(SkCanvas* canvas) const {
}
SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src,
- const SkRect& dst, const SkPaint* paint) {
+ const SkRect& dst, const SkPaint* paint,
+ SkCanvas::DrawBitmapRectFlags flags) {
fBitmap = bitmap;
if (NULL != src) {
fSrc = *src;
@@ -357,6 +358,8 @@ SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const S
} else {
fPaintPtr = NULL;
}
+ fFlags = flags;
+
fDrawType = DRAW_BITMAP_RECT_TO_RECT;
fInfo.push(SkObjectParser::BitmapToString(bitmap));
@@ -367,10 +370,11 @@ SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const S
if (NULL != paint) {
fInfo.push(SkObjectParser::PaintToString(*paint));
}
+ fInfo.push(SkObjectParser::IntToString(fFlags, "Flags: "));
}
void SkDrawBitmapRectCommand::execute(SkCanvas* canvas) {
- canvas->drawBitmapRectToRect(fBitmap, this->srcRect(), fDst, fPaintPtr);
+ canvas->drawBitmapRectToRect(fBitmap, this->srcRect(), fDst, fPaintPtr, fFlags);
}
bool SkDrawBitmapRectCommand::render(SkCanvas* canvas) const {
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index e62fe4f604..aabc2e0096 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -193,7 +193,8 @@ private:
class SkDrawBitmapRectCommand : public SkDrawCommand {
public:
SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src,
- const SkRect& dst, const SkPaint* paint);
+ const SkRect& dst, const SkPaint* paint,
+ SkCanvas::DrawBitmapRectFlags flags);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
@@ -209,17 +210,21 @@ public:
void setPaint(const SkPaint& paint) { fPaint = paint; fPaintPtr = &fPaint; }
const SkRect* srcRect() const { return fSrc.isEmpty() ? NULL : &fSrc; }
- const SkRect& dstRect() const { return fDst; }
-
void setSrcRect(const SkRect& src) { fSrc = src; }
+
+ const SkRect& dstRect() const { return fDst; }
void setDstRect(const SkRect& dst) { fDst = dst; }
+ SkCanvas::DrawBitmapRectFlags flags() const { return fFlags; }
+ void setFlags(SkCanvas::DrawBitmapRectFlags flags) { fFlags = flags; }
+
private:
- SkBitmap fBitmap;
- SkRect fSrc;
- SkRect fDst;
- SkPaint fPaint;
- SkPaint* fPaintPtr;
+ SkBitmap fBitmap;
+ SkRect fSrc;
+ SkRect fDst;
+ SkPaint fPaint;
+ SkPaint* fPaintPtr;
+ SkCanvas::DrawBitmapRectFlags fFlags;
typedef SkDrawCommand INHERITED;
};