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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1418863002: SkRemote: refactoring (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ID is not protocol sensitive 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkRemote.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SamplePipeControllers.h" 9 #include "SamplePipeControllers.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas ) { 1012 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas ) {
1013 PipeController controller(canvas, &SkImageDecoder::DecodeMemory); 1013 PipeController controller(canvas, &SkImageDecoder::DecodeMemory);
1014 SkGPipeWriter pipe; 1014 SkGPipeWriter pipe;
1015 const uint32_t kFlags = 0; 1015 const uint32_t kFlags = 0;
1016 return src.draw(pipe.startRecording(&controller, kFlags, size.width(), s ize.height())); 1016 return src.draw(pipe.startRecording(&controller, kFlags, size.width(), s ize.height()));
1017 }); 1017 });
1018 } 1018 }
1019 1019
1020 Error ViaRemote::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStr ing* log) const { 1020 Error ViaRemote::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStr ing* log) const {
1021 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) { 1021 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) {
1022 SkAutoTDelete<SkRemote::Cache> cache(fCache ? SkRemote::Cache::CreateAlw aysCache()
1023 : SkRemote::Cache::CreateNev erCache());
1024 SkRemote::Server server(canvas); 1022 SkRemote::Server server(canvas);
1025 SkRemote::Client client(cache, &server); 1023 SkAutoTDelete<SkRemote::Encoder> cache(fCache
1024 ? SkRemote::Encoder::CreateCachingEncoder(&server)
1025 : nullptr);
1026 SkRemote::Client client(cache.get() ? cache.get() : &server);
1026 return src.draw(&client); 1027 return src.draw(&client);
1027 }); 1028 });
1028 } 1029 }
1029 1030
1030 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 1031 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
1031 1032
1032 Error ViaSerialization::draw( 1033 Error ViaSerialization::draw(
1033 const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) cons t { 1034 const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) cons t {
1034 // Record our Src into a picture. 1035 // Record our Src into a picture.
1035 auto size = src.size(); 1036 auto size = src.size();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 skr.visit<void>(i, drawsAsSingletonPictures); 1212 skr.visit<void>(i, drawsAsSingletonPictures);
1212 } 1213 }
1213 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1214 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1214 1215
1215 canvas->drawPicture(macroPic); 1216 canvas->drawPicture(macroPic);
1216 return ""; 1217 return "";
1217 }); 1218 });
1218 } 1219 }
1219 1220
1220 } // namespace DM 1221 } // namespace DM
OLDNEW
« 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