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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 484673003: Record concat as setMatrix. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove no-op INHERITED calls Created 6 years, 4 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/SkRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index fda848835f37bc5fc5e2a7de99d4c0487ef76989..e792d3714305ba2ee4b33e33a4e87c50fcf1e19e 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -64,7 +64,6 @@ DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags));
DRAW(PopCull, popCull());
DRAW(PushCull, pushCull(r.rect));
DRAW(Clear, clear(r.color));
-DRAW(Concat, concat(r.matrix));
DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix)));
DRAW(ClipPath, clipPath(r.path, r.op, r.doAA));
@@ -120,7 +119,7 @@ public:
// Calculate bounds for all ops. This won't go quite in order, so we'll need
// to store the bounds separately then feed them in to the BBH later in order.
const SkIRect largest = SkIRect::MakeLargest();
- fCTM.setIdentity();
+ fCTM = &SkMatrix::I();
fCurrentClipBounds = largest;
for (fCurrentOp = 0; fCurrentOp < record.count(); fCurrentOp++) {
record.visit<void>(fCurrentOp, *this);
@@ -161,9 +160,8 @@ private:
};
template <typename T> void updateCTM(const T&) { /* most ops don't change the CTM */ }
- void updateCTM(const Restore& op) { fCTM = op.matrix; }
- void updateCTM(const SetMatrix& op) { fCTM = op.matrix; }
- void updateCTM(const Concat& op) { fCTM.preConcat(op.matrix); }
+ void updateCTM(const Restore& op) { fCTM = &op.matrix; }
+ void updateCTM(const SetMatrix& op) { fCTM = &op.matrix; }
template <typename T> void updateClipBounds(const T&) { /* most ops don't change the clip */ }
// Each of these devBounds fields is the state of the device bounds after the op.
@@ -186,7 +184,6 @@ private:
void trackBounds(const SaveLayer& op) { this->pushSaveBlock(op.paint); }
void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(); }
- void trackBounds(const Concat&) { this->pushControl(); }
void trackBounds(const SetMatrix&) { this->pushControl(); }
void trackBounds(const ClipRect&) { this->pushControl(); }
void trackBounds(const ClipRRect&) { this->pushControl(); }
@@ -359,7 +356,7 @@ private:
}
// Map the rect back to device space.
- fCTM.mapRect(&rect);
+ fCTM->mapRect(&rect);
SkIRect devRect;
rect.roundOut(&devRect);
@@ -376,7 +373,7 @@ private:
// and updateClipBounds() to maintain the exact CTM (fCTM) and conservative
// device bounds of the current clip (fCurrentClipBounds).
unsigned fCurrentOp;
- SkMatrix fCTM;
+ const SkMatrix* fCTM;
SkIRect fCurrentClipBounds;
// Used to track the bounds of Save/Restore blocks and the control ops inside them.
« no previous file with comments | « no previous file | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698