aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMiniRecorder.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-07-01 13:56:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-01 13:56:53 -0700
commit64b4c789fd1721d6804ccb5a9ceae39df03a5711 (patch)
tree7b1cd391c0b0f1a15b7d21f710ee2ac3fc053d69 /src/core/SkMiniRecorder.h
parent478c9e4851eff5feb74dd2f8a14143bec569e1a8 (diff)
Add support for drawBitmapRect() to SkMiniRecorder.
BUG=chromium:503705 Review URL: https://codereview.chromium.org/1220733006
Diffstat (limited to 'src/core/SkMiniRecorder.h')
-rw-r--r--src/core/SkMiniRecorder.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/SkMiniRecorder.h b/src/core/SkMiniRecorder.h
index 914eccc2e3..023e2ad55a 100644
--- a/src/core/SkMiniRecorder.h
+++ b/src/core/SkMiniRecorder.h
@@ -20,6 +20,8 @@ public:
~SkMiniRecorder();
// Try to record an op. Returns false on failure.
+ bool drawBitmapRectToRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
+ const SkPaint*, SkCanvas::DrawBitmapRectFlags);
bool drawPath(const SkPath&, const SkPaint&);
bool drawRect(const SkRect&, const SkPaint&);
bool drawTextBlob(const SkTextBlob*, SkScalar x, SkScalar y, const SkPaint&);
@@ -34,16 +36,24 @@ public:
void flushAndReset(SkCanvas*);
private:
- enum class State { kEmpty, kDrawPath, kDrawRect, kDrawTextBlob };
+ enum class State {
+ kEmpty,
+ kDrawBitmapRectToRectFixedSize,
+ kDrawPath,
+ kDrawRect,
+ kDrawTextBlob,
+ };
State fState;
template <size_t A, size_t B>
struct Max { static const size_t val = A > B ? A : B; };
- static const size_t kInlineStorage = Max<sizeof(SkRecords::DrawPath),
- Max<sizeof(SkRecords::DrawRect),
- sizeof(SkRecords::DrawTextBlob)>::val>::val;
+ static const size_t kInlineStorage =
+ Max<sizeof(SkRecords::DrawBitmapRectToRectFixedSize),
+ Max<sizeof(SkRecords::DrawPath),
+ Max<sizeof(SkRecords::DrawRect),
+ sizeof(SkRecords::DrawTextBlob)>::val>::val>::val;
SkAlignedSStorage<kInlineStorage> fBuffer;
};