aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMultiPictureDraw.cpp
Commit message (Collapse)AuthorAge
* Revert[2] "Change SkCanvas to *not* inherit from SkRefCnt"Gravatar Mike Reed2016-11-13
| | | | | | | | | | | | | | | | | Changes over original: - conditionalize ownership in SkPictureRecorder - conditionalize ownership in SkCanvasStateUtils This reverts commit b613c266df48cf45296ecc23d1bd7098c84bb7ba. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4742 Change-Id: Ib25514d6f546c69b6650b5c957403b04f7380dc2 Reviewed-on: https://skia-review.googlesource.com/4742 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Change SkCanvas to *not* inherit from SkRefCnt"Gravatar Heather Miller2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 824075071885b6b741c141cbe2134d8345d34589. Reason for revert: Breaking WebView (chromium:663959) Original change's description: > Change SkCanvas to *not* inherit from SkRefCnt > > Definitely tricky for classes like SkNWayCanvas, where the caller (today) > need not pay attention to ownership of the canvases it gave the NWay > (after this CL, the caller *must* managed ownership) > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4441 > > DOCS_PREVIEW= https://skia.org/?cl=4441 > > Change-Id: Ib1ac07a3cdf0686d78e7aaa4735d45cc90bea081 > Reviewed-on: https://skia-review.googlesource.com/4441 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=djsollen@google.com,mtklein@google.com,halcanary@google.com,robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I5e3b3e876b7d2c09833cf841801321033b6b968b Reviewed-on: https://skia-review.googlesource.com/4687 Commit-Queue: Heather Miller <hcm@google.com> Reviewed-by: Heather Miller <hcm@google.com>
* Change SkCanvas to *not* inherit from SkRefCntGravatar Mike Reed2016-11-09
| | | | | | | | | | | | | | | | | | Definitely tricky for classes like SkNWayCanvas, where the caller (today) need not pay attention to ownership of the canvases it gave the NWay (after this CL, the caller *must* managed ownership) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4441 DOCS_PREVIEW= https://skia.org/?cl=4441 Change-Id: Ib1ac07a3cdf0686d78e7aaa4735d45cc90bea081 Reviewed-on: https://skia-review.googlesource.com/4441 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove GrLayerHoisterGravatar robertphillips2016-07-13
| | | | | | | | This relies on https://codereview.chromium.org/1944013002/ (Add legacy flag to allow Skia to remove Ganesh layer hoister) landing first so as to not break the DEPS roll. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1950523002 Review-Url: https://codereview.chromium.org/1950523002
* Reland of Disable layer hoisting for non-8888 canvases (patchset #1 id:1 of ↵Gravatar robertphillips2016-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1961483002/ ) Reason for revert: This CL was not the culprit in the perf regression. Original issue's description: > Revert of Disable layer hoisting for non-8888 canvases (patchset #2 id:20001 of https://codereview.chromium.org/1957433002/ ) > > Reason for revert: > Experimental revert to investigate perf regression > > Original issue's description: > > Disable layer hoisting for non-8888 canvases > > > > This just stops the bleeding. A real fix would propagate the canvas' backing type down to the layer hoister. > > > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957433002 > > > > Committed: https://skia.googlesource.com/skia/+/4e30f27164179d344f0c8efa9a691d1bc9a53e3f > > TBR=bsalomon@google.com > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/6b53b9daeb2137a91d8ddb8e890d66c702bfbaa3 TBR=bsalomon@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. Review-Url: https://codereview.chromium.org/1962603002
* Revert of Disable layer hoisting for non-8888 canvases (patchset #2 id:20001 ↵Gravatar robertphillips2016-05-06
| | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1957433002/ ) Reason for revert: Experimental revert to investigate perf regression Original issue's description: > Disable layer hoisting for non-8888 canvases > > This just stops the bleeding. A real fix would propagate the canvas' backing type down to the layer hoister. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957433002 > > Committed: https://skia.googlesource.com/skia/+/4e30f27164179d344f0c8efa9a691d1bc9a53e3f TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1961483002
* Disable layer hoisting for non-8888 canvasesGravatar robertphillips2016-05-05
| | | | | | | | This just stops the bleeding. A real fix would propagate the canvas' backing type down to the layer hoister. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957433002 Review-Url: https://codereview.chromium.org/1957433002
* Clean up test drawContext usageGravatar robertphillips2016-04-28
| | | | | | | | The general idea is to provide access to SkGpuDevice's drawContext rather than its GrRenderTarget. That is usually what the testing framework actually wants. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930623003 Review-Url: https://codereview.chromium.org/1930623003
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* If we swap its arguments, SkTaskGroup::batch() _is_ sk_parallel_for.Gravatar mtklein2016-01-04
| | | | | | | | | | | Why have two names if we can get away with one? This kills off sk_parallel_for_thread_count(), which was only used to avoid forcing a deadlock in OncePtrTest on multicore machines in singlethreaded mode... a really niche use case. Instead just don't explicitly force a race. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1552093002 Review URL: https://codereview.chromium.org/1552093002
* Update Layer Hoisting to store its atlas texture in the resource cacheGravatar robertphillips2015-11-09
| | | | | | | | BUG=skia:4346 Committed: https://skia.googlesource.com/skia/+/42597bc99f00553825843b5ed41e81b121773368 Review URL: https://codereview.chromium.org/1406013006
* Revert of Update Layer Hoisting to store its atlas texture in the resource ↵Gravatar robertphillips2015-11-06
| | | | | | | | | | | | | | | | | | | | | | cache (patchset #6 id:100001 of https://codereview.chromium.org/1406013006/ ) Reason for revert: Android Original issue's description: > Update Layer Hoisting to store its atlas texture in the resource cache > > BUG=skia:4346 > > Committed: https://skia.googlesource.com/skia/+/42597bc99f00553825843b5ed41e81b121773368 TBR=bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4346 Review URL: https://codereview.chromium.org/1413483004
* Update Layer Hoisting to store its atlas texture in the resource cacheGravatar robertphillips2015-11-06
| | | | | | BUG=skia:4346 Review URL: https://codereview.chromium.org/1406013006
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Add sk_parallel_for()Gravatar mtklein2015-06-17
| | | | | | | | | | | | | | | | | | | | | | | | This should be a drop-in replacement for most for-loops to make them run in parallel: for (int i = 0; i < N; i++) { code... } ~~~> sk_parallel_for(N, [&](int i) { code... }); This is just syntax sugar over SkTaskGroup to make this use case really easy to write. There's no more overhead that we weren't already forced to add using an interface like batch(), and no extra heap allocations. I've replaced 3 uses of SkTaskGroup with sk_parallel_for: 1) My unit tests for SkOnce. 2) Cary's path fuzzer. 3) SkMultiPictureDraw. Performance should be the same. Please compare left and right for readability. :) BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1184373003
* Implement support for mixed sampled render targetsGravatar vbuzinov2015-06-12
| | | | | | | | | | | | | | | | | | Adds a new FBO type kStencil_MSFBOType that is selected whenever NV_framebuffer_mixed_samples extension is available. In this new FBO type a non-msaa color buffer is created with a multisampled stencil buffer attachment. Replaces numSamples() with separate numColorSamples and numStencilSamples methods in RenderTarget. In mixed samples mode non-MSAA codepaths are used to draw simple shapes, while NVPR-rendered paths and text are rendered with a multisampled stencil. BUG=skia:3177 Review URL: https://codereview.chromium.org/1001503002
* Add a flag to flush the canvases during SkMultiPictureDraw::draw().Gravatar senorblanco2015-01-28
| | | | | | | | | | This is necessary for multisampling, so that each multisampled render target resolves before Chrome's compositor attempts to draw the texture. BUG=skia: Review URL: https://codereview.chromium.org/878653004
* fix images in multi-thread by doing shallow-copiesGravatar reed2014-12-25
| | | | | | | BUG=skia: TBR=mtklein@google.com Review URL: https://codereview.chromium.org/791473006
* Fuse GrReplacements and GrLayerCacheGravatar robertphillips2014-12-03
| | | | | | The conversion step from GrCachedLayer to ReplacementInfo isn't necessary. Review URL: https://codereview.chromium.org/769533004
* Use variable length key (rather than accumulated matrix) as save layer ↵Gravatar robertphillips2014-12-01
| | | | | | | | | | hoisting key Adding the rendering canvas' CTM to the layer hoisting key (i.e., Add support for hoisting layers in pictures drawn with a matrix - https://codereview.chromium.org/748853002/) has increased the cache miss rate due to accumulated floating point error. This CL fixes part of the issue by using the chain of operation indices leading to each saveLayer as the key. The canvas' CTM must still form part of the key but should be less subject to accumulated error. BUG=skia:2315 Review URL: https://codereview.chromium.org/753253002
* Add support for hoisting layers in pictures drawn with a matrixGravatar robertphillips2014-11-24
| | | | | | | | Although Chromium doesn't use the drawPicture matrix parameter for their tiling, our local code does. Without such drawPicture calls break layer hoisting. BUG=skia:2315 Review URL: https://codereview.chromium.org/748853002
* Change where layer hoisting data is gatheredGravatar robertphillips2014-11-11
| | | | | | | | | | | | This CL: 1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice 2) moves the saveLayer gathering step to endRecording 3) Replaces GPUOptimize with SkRecordComputeLayers 4) Update bench_pictures & render_pictures to provide the new flag #2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording) Review URL: https://codereview.chromium.org/718443002
* Address MSAA rendering in layer hoistingGravatar robertphillips2014-11-10
| | | | | | This became relevant whilst attempting to rebaseline the multipicturedraw GMs after turning on layer hoisting inside Skia. Review URL: https://codereview.chromium.org/709943003
* Include SkTypes so that SK_SUPPORT_GPU is meaningful.Gravatar scroggo2014-11-04
| | | | | | | | | | For the Android framework build, we get our defines from SkUserConfig, rather than from the makefile, so we need to include it (via SkTypes) before we can use our defines. Fixes Android framework build. Review URL: https://codereview.chromium.org/700893002
* Turn SkTaskGroups back on.Gravatar mtklein2014-11-03
| | | | | | | | | | | | | Revert "Disable SkTaskGroup in SkMultiPictureDraw temporarily." Revert "Revert harder, removing SkTaskGroup.cpp from core temporarily." NOTREECHECKS=true BUG=skia: Committed: https://skia.googlesource.com/skia/+/2100c5ed7a5e5470a04e7af7309d8bd3fc4249f7 Review URL: https://codereview.chromium.org/687263007
* Always enable layer hoisting in SkiaGravatar robertphillips2014-11-03
| | | | | | This will prevent bit rot of the layer hoisting code and position us better for turning this on in Chromium. Review URL: https://codereview.chromium.org/698493002
* Revert of Turn SkTaskGroups back on. (patchset #1 id:1 of ↵Gravatar mtklein2014-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/687263007/) Reason for revert: precautionary revert. may have caused WinXP crashes on Chrome tree: https://code.google.com/p/chromium/issues/detail?id=429207 Original issue's description: > Turn SkTaskGroups back on. > > Revert "Disable SkTaskGroup in SkMultiPictureDraw temporarily." > Revert "Revert harder, removing SkTaskGroup.cpp from core temporarily." > > NOTREECHECKS=true > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/2100c5ed7a5e5470a04e7af7309d8bd3fc4249f7 TBR=reed@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/693993002
* Turn SkTaskGroups back on.Gravatar mtklein2014-10-31
| | | | | | | | | | | Revert "Disable SkTaskGroup in SkMultiPictureDraw temporarily." Revert "Revert harder, removing SkTaskGroup.cpp from core temporarily." NOTREECHECKS=true BUG=skia: Review URL: https://codereview.chromium.org/687263007
* Fix member variable namingGravatar robertphillips2014-10-30
| | | | | | | | This renaming was missed in (MultiPictureDraw is taskgroup aware - https://codereview.chromium.org/684923002) TBR=reed@google.com Review URL: https://codereview.chromium.org/654293005
* Disable SkTaskGroup in SkMultiPictureDraw temporarily.Gravatar mtklein2014-10-30
| | | | | | | | Think this should be enough to get rolling again. NOTREECHECKS=true Review URL: https://codereview.chromium.org/687273006
* use SkTaskGroup::batchGravatar reed2014-10-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/688753002
* SkTaskGroup::batch(fn, args, N)Gravatar mtklein2014-10-29
| | | | | | | | Porting QuiltTask isn't important in itself; this is mostly an API feeler. BUG=skia: Review URL: https://codereview.chromium.org/689673003
* Discard atlas after every MultiPictureDraw::drawGravatar robertphillips2014-10-29
| | | | | | | | | | This is intended to prevent ghosting on tiled architectures. This CL also defers creation of the atlas (and its texture) until it is actually needed. Committed: https://skia.googlesource.com/skia/+/6d5b5455743414ddb11d2b8c1fe9d7959f2b853d Review URL: https://codereview.chromium.org/678403002
* MultiPictureDraw is taskgroup aware.Gravatar reed2014-10-29
| | | | | | | | SampleApp is multipicturedraw aware. BUG=skia: Review URL: https://codereview.chromium.org/684923002
* Revert of Discard atlas after every MultiPictureDraw::draw (patchset #4 ↵Gravatar robertphillips2014-10-29
| | | | | | | | | | | | | | | | | | | | | | id:60001 of https://codereview.chromium.org/678403002/) Reason for revert: Breaking bots Original issue's description: > Discard atlas after every MultiPictureDraw::draw > > This is intended to prevent ghosting on tiled architectures. > > This CL also defers creation of the atlas (and its texture) until it is actually needed. > > Committed: https://skia.googlesource.com/skia/+/6d5b5455743414ddb11d2b8c1fe9d7959f2b853d TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/687233002
* Discard atlas after every MultiPictureDraw::drawGravatar robertphillips2014-10-29
| | | | | | | | This is intended to prevent ghosting on tiled architectures. This CL also defers creation of the atlas (and its texture) until it is actually needed. Review URL: https://codereview.chromium.org/678403002
* Alter layer hoisting to only hoist layers for one canvas at a timeGravatar robertphillips2014-10-28
| | | | | | | | | | This CL alters layer hoisting to defer creation of the free floating layers until they are actually needed (rather than creating _all_ the hoisted layers at the start). It also fixes a pre vs. post Concat bug with how matrices were being accumulated. BUG=skia:2315 Review URL: https://codereview.chromium.org/657383004
* Expose layer hoisting API in GrContextGravatar robertphillips2014-10-08
| | | | | | This CL exposes the layer hoisting API in GrContext for use in SkMultiPictureDraw::draw. It basically mirrors what SkGpuDevice::EXPERIMENTAL_drawPicture has been doing. Review URL: https://codereview.chromium.org/533673002
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* SkMultiPictureDraw APIGravatar robertphillips2014-08-21
This CL adds a new API to optimize across multiple SkPicture draw calls. Note that multiple pictures rendered at once (i.e., picture piles) should be flattened into a single new picture that includes the required clipping on the different layers. R=bsalomon@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/491313003