Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 83b89f4d6a3b471e561616f2a446a9a4b1d43025..98ab086cd306205752ae5aca82afb6fd0082028d 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -1162,13 +1162,12 @@ Error ViaPipe::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStrin |
} |
Error ViaRemote::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const { |
- return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) { |
- SkRemote::Server server(canvas); |
- SkAutoTDelete<SkRemote::Encoder> cache(fCache |
- ? SkRemote::Encoder::CreateCachingEncoder(&server) |
- : nullptr); |
- SkRemote::Client client(cache.get() ? cache.get() : &server); |
- return src.draw(&client); |
+ return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* target) { |
+ SkAutoTDelete<SkRemote::Encoder> decoder(SkRemote::NewDecoder(target)); |
+ SkAutoTDelete<SkRemote::Encoder> cache(fCache ? SkRemote::NewCachingEncoder(decoder) |
+ : nullptr); |
+ SkAutoTDelete<SkCanvas> canvas(SkRemote::NewCanvas(cache ? cache : decoder)); |
+ return src.draw(canvas); |
}); |
} |