Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1979)

Unified Diff: dm/DMSrcSink.cpp

Issue 1409113005: SkRemote: more refactoring (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: forward declares Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkRemote.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
});
}
« no previous file with comments | « no previous file | src/core/SkRemote.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698