Index: src/core/SkRecordDraw.cpp |
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp |
index 0117adeefaec04a2d8f85a6a8f04dbc743c46495..f7f02997dfb149045f98722546e1ec75fcb45184 100644 |
--- a/src/core/SkRecordDraw.cpp |
+++ b/src/core/SkRecordDraw.cpp |
@@ -35,15 +35,29 @@ void SkRecordDraw(const SkRecord& record, |
} |
} else { |
// Draw all ops. |
- for (SkRecords::Draw draw(canvas); draw.index() < record.count(); draw.next()) { |
+ SkRecords::Draw draw(canvas); |
+ for (unsigned i = 0; i < record.count(); i++) { |
if (NULL != callback && callback->abortDrawing()) { |
return; |
} |
- record.visit<void>(draw.index(), draw); |
+ record.visit<void>(i, draw); |
} |
} |
} |
+void SkRecordPartialDraw(const SkRecord& record, |
+ SkCanvas* canvas, |
+ const SkRect& clearRect, |
+ unsigned start, unsigned stop) { |
+ SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); |
+ |
+ stop = SkTMin(stop, record.count()); |
+ SkRecords::PartialDraw draw(canvas, clearRect); |
+ for (unsigned i = start; i < stop; i++) { |
+ record.visit<void>(i, draw); |
+ } |
+} |
+ |
namespace SkRecords { |
// FIXME: SkBitmaps are stateful, so we need to copy them to play back in multiple threads. |