Add push/pop cull to SkRecord.

BUG=skia:2378
R=fmalita@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/224723026

git-svn-id: http://skia.googlecode.com/svn/trunk@14091 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-04-08 15:17:17 +00:00
parent 43c27586e8
commit 03a99b8f96
4 changed files with 20 additions and 1 deletions

View File

@ -25,6 +25,9 @@ CASE(Restore) { canvas->restore(); }
CASE(Save) { canvas->save(r.flags); }
CASE(SaveLayer) { canvas->saveLayer(r.bounds, r.paint, r.flags); }
CASE(PushCull) { canvas->pushCull(r.rect); }
CASE(PopCull) { canvas->popCull(); }
CASE(Concat) { canvas->concat(r.matrix); }
CASE(SetMatrix) { canvas->setMatrix(r.matrix); }

View File

@ -195,6 +195,14 @@ void SkRecorder::willRestore() {
APPEND(Restore);
}
void SkRecorder::onPushCull(const SkRect& rect) {
APPEND(PushCull, rect);
}
void SkRecorder::onPopCull() {
APPEND(PopCull);
}
void SkRecorder::didConcat(const SkMatrix& matrix) {
APPEND(Concat, matrix);
}

View File

@ -57,6 +57,9 @@ public:
void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle);
void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op);
void onPushCull(const SkRect& cullRect);
void onPopCull();
private:
template <typename T>
T* copy(const T*);

View File

@ -39,7 +39,9 @@ namespace SkRecords {
M(DrawSprite) \
M(DrawText) \
M(DrawTextOnPath) \
M(DrawVertices)
M(DrawVertices) \
M(PushCull) \
M(PopCull)
// Defines SkRecords::Type, an enum of all record types.
#define ENUM(T) T##_Type,
@ -125,6 +127,9 @@ RECORD0(Restore);
RECORD1(Save, SkCanvas::SaveFlags, flags);
RECORD3(SaveLayer, SkRect*, bounds, SkPaint*, paint, SkCanvas::SaveFlags, flags);
RECORD1(PushCull, SkRect, rect);
RECORD0(PopCull);
RECORD1(Concat, SkMatrix, matrix);
RECORD1(SetMatrix, SkMatrix, matrix);