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

Unified Diff: src/core/SkRecordDraw.h

Issue 549143003: Fix bug in layer hoisting transition to SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 6 years, 3 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/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.h
diff --git a/src/core/SkRecordDraw.h b/src/core/SkRecordDraw.h
index 033b76d34ae5d1cc0934a7d347a3f2136ff92c7e..35b0da6bfc1c627f986411a289438f15895c2293 100644
--- a/src/core/SkRecordDraw.h
+++ b/src/core/SkRecordDraw.h
@@ -11,6 +11,7 @@
#include "SkBBoxHierarchy.h"
#include "SkCanvas.h"
#include "SkDrawPictureCallback.h"
+#include "SkMatrix.h"
#include "SkRecord.h"
// Fill a BBH to be used by SkRecordDraw to accelerate playback.
@@ -20,7 +21,12 @@ void SkRecordFillBounds(const SkRecord&, SkBBoxHierarchy*);
void SkRecordDraw(const SkRecord&, SkCanvas*, const SkBBoxHierarchy*, SkDrawPictureCallback*);
// Draw a portion of an SkRecord into an SkCanvas while replacing clears with drawRects.
-void SkRecordPartialDraw(const SkRecord&, SkCanvas*, const SkRect&, unsigned start, unsigned stop);
+// When drawing a portion of an SkRecord the CTM on the passed in canvas must be
+// the composition of the replay matrix with the record-time CTM (for the portion
+// of the record that is being replayed). For setMatrix calls to behave correctly
+// the initialCTM parameter must set to just the replay matrix.
+void SkRecordPartialDraw(const SkRecord&, SkCanvas*, const SkRect&, unsigned start, unsigned stop,
+ const SkMatrix& initialCTM);
namespace SkRecords {
@@ -34,19 +40,23 @@ public:
this->draw(r);
}
+protected:
+ SkMatrix fInitialCTM;
+
private:
// No base case, so we'll be compile-time checked that we implement all possibilities.
template <typename T> void draw(const T&);
- const SkMatrix fInitialCTM;
SkCanvas* fCanvas;
};
// Used by SkRecordPartialDraw.
class PartialDraw : public Draw {
public:
- PartialDraw(SkCanvas* canvas, const SkRect& clearRect)
- : INHERITED(canvas), fClearRect(clearRect) {}
+ PartialDraw(SkCanvas* canvas, const SkRect& clearRect, const SkMatrix& initialCTM)
+ : INHERITED(canvas), fClearRect(clearRect) {
+ fInitialCTM = initialCTM;
+ }
// Same as Draw for all ops except Clear.
template <typename T> void operator()(const T& r) {
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698