Eager or Lazy evaluation of sub-drawings for SkDeferredCanvas.
Allow evaluation choice of Lazy or Eager evaluation for SkDeferredCanvas.
Eager is used for drawing to a non-recording canvas to reduce the number of
all operations.
Lazy is used for drawing to a recording canvas to reduce the amount decode/encode
that happens.
R=reed@google.com
Change-Id: I7837c4f6e5911c153e0796162e1170edbc34839e
Reviewed-on: https://skia-review.googlesource.com/9839
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 14d5552..eb9ba41 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1661,7 +1661,7 @@
Error ViaDefer::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
auto size = src.size();
return draw_to_canvas(fSink.get(), bitmap, stream, log, size, [&](SkCanvas* canvas) -> Error {
- SkDeferredCanvas deferred(canvas);
+ SkDeferredCanvas deferred(canvas, SkDeferredCanvas::kEager);
return src.draw(&deferred);
});
}