From ad8a43f7698071f00ce024a935b0bc04a4b19a41 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 30 Aug 2017 12:06:35 -0400 Subject: DeferredDisplayList API proposal Chrome would like to perform cpu-side preprocessing for gpu draws in parallel. They do not want to go through a picture (since they have their own display list format). The general idea is that we add a new SkDeferredDisplayListRecorder class to perform all of Ganesh's cpu-side preprocessing ahead of time and in parallel. The SkDDLRecorder operates like SkPictureRecorder. The user can get an SkCanvas from the SkDDLRecorder and feed it draw operations. Once finished, the user calls 'detach' to get an SkDeferredDisplayList. All the work up to and including the 'detach' call can be done in parallel and will not touch the GPU. To actually get pixels the client must call SkSurface::draw(SkDDL) on an SkSurface that is "compatible" with the surface characterization initially given to the SkDDLMaker. The surface characterization contains the minimum amount of information Ganesh needs to know about the ultimate destination in order to perform its cpu-side work (i.e., caps, width, height, config). Change-Id: I75faa483ab5a6b779c8de56ea56b9d90b990f43a Reviewed-on: https://skia-review.googlesource.com/30140 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- dm/DM.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index 1c89ae0fdd..044fea5907 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -92,6 +92,8 @@ DEFINE_int32(shard, 0, "Which shard do I run?"); DEFINE_string(mskps, "", "Directory to read mskps from, or a single mskp file."); DEFINE_bool(forceRasterPipeline, false, "sets gSkForceRasterPipelineBlitter"); +DEFINE_bool(ddl, false, "If true, use DeferredDisplayLists for GPU SKP rendering."); + #if SK_SUPPORT_GPU DEFINE_pathrenderer_flag; #endif @@ -773,7 +775,11 @@ static bool gather_srcs() { push_src("gm", "", new GMSrc(r->factory())); } - gather_file_srcs(FLAGS_skps, "skp"); + if (FLAGS_ddl) { + gather_file_srcs(FLAGS_skps, "skp"); + } else { + gather_file_srcs(FLAGS_skps, "skp"); + } gather_file_srcs(FLAGS_mskps, "mskp"); #if defined(SK_XML) gather_file_srcs(FLAGS_svgs, "svg"); -- cgit v1.2.3