本文整理汇总了C++中SkRecord::visit方法的典型用法代码示例。如果您正苦于以下问题:C++ SkRecord::visit方法的具体用法?C++ SkRecord::visit怎么用?C++ SkRecord::visit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkRecord
的用法示例。
在下文中一共展示了SkRecord::visit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void SkBigPicture::Analysis::init(const SkRecord& record) {
TRACE_EVENT0("disabled-by-default-skia", "SkBigPicture::Analysis::init()");
SkBitmapHunter bitmap;
SkPathCounter path;
bool hasBitmap = false;
for (int i = 0; i < record.count(); i++) {
hasBitmap = hasBitmap || record.visit(i, bitmap);
record.visit(i, path);
}
fWillPlaybackBitmaps = hasBitmap;
fNumSlowPathsAndDashEffects = SkTMin<int>(path.fNumSlowPathsAndDashEffects, 255);
}
示例2: SkRecordDraw
void SkRecordDraw(const SkRecord& record,
SkCanvas* canvas,
SkPicture const* const drawablePicts[],
SkDrawable* const drawables[],
int drawableCount,
const SkBBoxHierarchy* bbh,
SkPicture::AbortCallback* callback) {
SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
if (bbh) {
// Draw only ops that affect pixels in the canvas's current clip.
// The SkRecord and BBH were recorded in identity space. This canvas
// is not necessarily in that same space. getClipBounds() returns us
// this canvas' clip bounds transformed back into identity space, which
// lets us query the BBH.
SkRect query;
if (!canvas->getClipBounds(&query)) {
query.setEmpty();
}
SkTDArray<int> ops;
bbh->search(query, &ops);
SkRecords::Draw draw(canvas, drawablePicts, drawables, drawableCount);
for (int i = 0; i < ops.count(); i++) {
if (callback && callback->abort()) {
return;
}
// This visit call uses the SkRecords::Draw::operator() to call
// methods on the |canvas|, wrapped by methods defined with the
// DRAW() macro.
record.visit(ops[i], draw);
}
} else {
// Draw all ops.
SkRecords::Draw draw(canvas, drawablePicts, drawables, drawableCount);
for (int i = 0; i < record.count(); i++) {
if (callback && callback->abort()) {
return;
}
// This visit call uses the SkRecords::Draw::operator() to call
// methods on the |canvas|, wrapped by methods defined with the
// DRAW() macro.
record.visit(i, draw);
}
}
}
示例3: SkRecordFillBounds
void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect bounds[]) {
SkRecords::FillBounds visitor(cullRect, record, bounds);
for (int curOp = 0; curOp < record.count(); curOp++) {
visitor.setCurrentOp(curOp);
record.visit(curOp, visitor);
}
visitor.cleanUp();
}
示例4: DumpRecord
void DumpRecord(const SkRecord& record,
SkCanvas* canvas,
bool timeWithCommand) {
Dumper dumper(canvas, record.count(), timeWithCommand);
for (int i = 0; i < record.count(); i++) {
record.visit(i, dumper);
}
}
示例5: SkRecordPartialDraw
void SkRecordPartialDraw(const SkRecord& record, SkCanvas* canvas,
SkPicture const* const drawablePicts[], int drawableCount,
int start, int stop,
const SkMatrix& initialCTM) {
SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
stop = SkTMin(stop, record.count());
SkRecords::Draw draw(canvas, drawablePicts, nullptr, drawableCount, &initialCTM);
for (int i = start; i < stop; i++) {
record.visit(i, draw);
}
}
示例6: SkRecordDraw
void SkRecordDraw(const SkRecord& record, SkCanvas* canvas) {
for (Draw draw(canvas); draw.index() < record.count(); draw.next()) {
record.visit(draw.index(), draw);
}
}
示例7: apply
void apply(const SkRecord& record) {
for (int i = 0; i < record.count(); i++) {
record.visit(i, *this);
}
}