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

Unified Diff: src/core/SkMiniRecorder.h

Issue 1220733006: Add support for drawBitmapRect() to SkMiniRecorder. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/core/SkMiniRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMiniRecorder.h
diff --git a/src/core/SkMiniRecorder.h b/src/core/SkMiniRecorder.h
index 914eccc2e38a5c9b26b8f0224d051049ac64dea6..023e2ad55a73d64aff7e9547f066c739105a350e 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;
};
« no previous file with comments | « no previous file | src/core/SkMiniRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698