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));
// 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);
};
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.
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(); }
}
// Map the rect back to device space.
- fCTM.mapRect(&rect);
+ fCTM->mapRect(&rect);
SkIRect devRect;
rect.roundOut(&devRect);
// 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.
void SkRecorder::willSave() {
APPEND(Save);
- INHERITED(willSave);
}
SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
const SkPaint* paint,
SkCanvas::SaveFlags flags) {
APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags);
- INHERITED(willSaveLayer, bounds, paint, flags);
return SkCanvas::kNoLayer_SaveLayerStrategy;
}
void SkRecorder::didRestore() {
APPEND(Restore, this->devBounds(), this->getTotalMatrix());
- INHERITED(didRestore);
}
void SkRecorder::onPushCull(const SkRect& rect) {
}
void SkRecorder::didConcat(const SkMatrix& matrix) {
- APPEND(Concat, matrix);
- INHERITED(didConcat, matrix);
+ this->didSetMatrix(this->getTotalMatrix());
}
void SkRecorder::didSetMatrix(const SkMatrix& matrix) {
SkASSERT(matrix == this->getTotalMatrix());
APPEND(SetMatrix, matrix);
- INHERITED(didSetMatrix, matrix);
}
void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
M(SaveLayer) \
M(PushCull) \
M(PopCull) \
- M(Concat) \
M(SetMatrix) \
M(ClipPath) \
M(ClipRRect) \
RECORD1(PushCull, SkRect, rect);
RECORD0(PopCull);
-RECORD1(Concat, SkMatrix, matrix);
RECORD1(SetMatrix, SkMatrix, matrix);
RECORD4(ClipPath, SkIRect, devBounds, SkPath, path, SkRegion::Op, op, bool, doAA);