The new name is symmetric with the existing AddLayerInPendingTree()
and is clearer about the intent. This is a part of the change to make
commit-to-pending-tree the default for most unit tests, to make it
possible to check IsSyncTree() when we are committing in e.g.
PictureLayerImpl::UpdateRasterSource() to prevent errors.
Change-Id: I6bbf84f3bfbe27db20e16f2bbd2d0d9d985beb00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5671061
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322286}
This allows blink code to use these types without needing to depend
on ui/gfx.
Split out geometry conversion functions from ui/gfx/skia_util.h into
ui/gfx/geometry/skia_conversions.h.
Split //ui/gfx:geometry_skia into //ui/gfx:gfx_skia and
//ui/gfx/geometry:geometry_skia.
This doesn't change depending code except for cc/.
Bug: 738465
Change-Id: Idb31f605386901ed4b116f6272189c18638d3292
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3200392
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Owners-Override: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929022}
Instead of creating and destroying the ClientResourceProvider with
the LayerTreeFrameSink, create it once and keep it around until the
LayerTreeHostImpl is destroyed. This allows ResourceIds to remain
valid when the LayerTreeFrameSink is replaced while software
compositing (which can happen if the viz service crashes).
We add a method ShutdownAndReleaseAllResources() on
ClientResourceProvider that will release any exported resources,
marking them as lost, instead of doing so in the destructor,
so that the owner of the class can control the timing more without
needing to heap-allocate the class.
We also take away the allowance for importing a ResourceId and
not removing it before destroying the ClientResourceProvider (or
calling ShutdownAndReleaseAllResources()). Instead we have it
DCHECK() if this occurs, reporting the stack trace from where
the resource was imported. We do this because marking resources
that are not exported as lost is silly, since they were imported
they could have been removed. A bunch of unit test changes are done
to remove resources that were imported because of this.
Two unit tests that tested the case of destroying the
ClientResourceProvider while imported resources were present are
removed since it is no longer supported.
When the CompositorFrameSink is lost, the LayerTreeHostImpl loses
the ability to receive back resources it had previously exported.
We add a method ReleaseAllExportedResources() on
ClientResourceProvider to handle this case, which removes the
export count on all resources, releasing any marked for deletion
previously. When software compositing, they do not need to be
marked lost, but when gpu compositing they do since the display
compositor modifies texture metadata in order to use them. Tests
for the new method are added, as well as to verify that in
LayerTreeHostImpl, when the CompositorFrameSink is replaced, that
the ResourceIds are not kept around.
The software-resources-aren't-lost distinction is not important in
this CL, since LayerTreeHostImpl destroys all its resources
regardless when it tears down the ResourcePool and
RasterBufferProvider. However for external clients which provide a
resource through TextureLayer, the ResourceId can remain valid in
software compositing.
R=piman@chromium.org
Bug: 826886
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I85a867c2830c31d39796ff971e01a221e5716812
Reviewed-on: https://chromium-review.googlesource.com/1083617
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565464}
These classes are part of the CompositorFrame shipped over IPC to the viz service and
should be in components/viz/common. This moves all subclasses of viz::DrawQuad from
cc/quads to components/viz/common/quads, and updates headers and namespaces throughout
chromium.
TBR=jam
Bug: 722935
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Ib7ce371cc78304b9147c319987d2d582f3b56978
Reviewed-on: https://chromium-review.googlesource.com/667539
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502329}
Adding a new field, are_contents_opaque, to SharedQuadState (SQS), which
is set to true if and only if all the draw quads that share the same SQS
only contains opaque content. This field will be used to determine if the
visible rect created by a particular SQS is opaque, which will be used to
occlude draw quads behind it to improve draw occulsion in the futre.
TBR=qinmin@chromium.org
TEST= Adding verification SQS::are_contents_opaque to all sqs related tests.
Bug: 672929
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I922ac85b84c5e4b39881c6f0c8e47a92802d397d
Reviewed-on: https://chromium-review.googlesource.com/585604
Commit-Queue: Yi Xu <yiyix@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499740}
Along with all associated names such as clients and subclasses.
CompositorFrameSink is the name of the mojo APIs. Now that IPC is thru
mojo, these APIs are actual C++ type names. Having other C++ types with
the same name is eternally confusing.
In the future one day LayerTreeFrameSink will submit ContentFrames or
so instead of CompositorFrames, luckily its name won't need to change
at that time.
This CL is not opinionated on what things *should* be using. There are
some places that are using LayerTreeFrameSinks that clearly should not
be since they are not involved with LayerTreeHost. However this CL
makes these more obvious instead of being hidden.
Once this is done, we may rename the MojoCompositorFrameSink API to
CompositorFrameSink and be free of the mojom::Mojo conundrum.
R=enne@chromium.org, fsamuel@chromium.orgTBR=sky@chromium.org, jam@chromium.org
Bug: 722935
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I26377c13f46fc7aff9bb4f43590ee7e42c00df40
Reviewed-on: https://chromium-review.googlesource.com/538096
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481086}
They're only used by the ResourceProvider, so there's no fundamental reason for
them to take a separate path through the compositor. Besides, it is natural that
the CompositorFrameSink contains all the objects needed to create resources, all
at the same place. Finally, it's less code overall.
BUG=None
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
Review-Url: https://codereview.chromium.org/2452483002
Cr-Commit-Position: refs/heads/master@{#428551}
After this, OutputSurface is only used for the display
compositor (ie cc::Display and friends). And the
CompositorFrameSink API is used for the layer tree
compositor (ie LayerTreeHost and friends).
OutputSurfaceClient is also forked to an identical
CompositorFrameSinkClient.
For now the two are identical, after this they can diverge
and we can delete things on each that doesn't apply anymore.
Broad renamings are:
SynchronousCompositorOutputSurface -> SynchronousCompositorFrameSink
blimp::DelegatedOutputSurface -> BlimpCompositorFrameSink
BlimpOutputSurfaceClient -> BlimpCompositorFrameSinkProxy
BlimpOutputSurface -> BlimpCompositorFrameSinkProxyClient
SurfaceDisplayOutputSurface -> DirectCompositorFrameSink
TestDelegatingOutputSurface -> TestCompositorFrameSink
CompositorOutputSurface -> RendererCompositorFrameSink
mus::OutputSurface -> mus::CompositorFrameSink
TBR=piman
BUG=606056
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
Review-Url: https://codereview.chromium.org/2337913003
Cr-Commit-Position: refs/heads/master@{#418754}
For tests other than a few LayerTreeTests, this changes all tests that
used a DirectRenderer to use a DelegatingRenderer instead.
FakeLayerTreeHostClient took options for allowing fake software
compositing, but it was unused. The REMOTE_DIRECT_RENDERER_TEST_F macro
was also unused now.
(Also enables SurfaceLayerSwapPromiseWithDraw which was disabled but
the bug is fixed.)
R=enne
TBR=miguelg
BUG=421923,606056
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_blink_rel
Review-Url: https://codereview.chromium.org/2171143002
Cr-Commit-Position: refs/heads/master@{#407280}
This CL moves double_sided and force_render_surface from LayerImpl to
LayerImplTestProperties and also deletes non-test calls to
SetForceRenderSurface on Layer.
BUG=602438
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1912893002
Cr-Commit-Position: refs/heads/master@{#389256}
Move render target related information to effect tree and clean up
render target logic.
This CL's major change includes:
1. Effect node's target_id is updated every frame
2. Effect node's target_id always points to closest ancestor that has a
render surface, and never points to itself.
3. LayerImpl's render target returns the RenderSurfaceImpl that the
layer contributes to. It is possible the LayerImpl owns that
RenderSurfaceImpl.
4. RenderSurfaceImpl's render target returns the RenderSurfaceImpl that
the render surface contributes to.
Resulting from this CL, effect tree can be walked upwards using
target_id, and render target information can be queried from effect
tree.
R=ajuma, enne
BUG=504464, 594675
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1868003002
Cr-Commit-Position: refs/heads/master@{#386399}
The impl side of the compositor uses Proxy to only access the
task runners and make debug assertions. Move those parts to
TaskRunnerProvider to seperate these dependencies.
BUG=527200
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1411663002
Cr-Commit-Position: refs/heads/master@{#355370}
There are no call sites that need this anymore, the behavior
can be achieved in other ways now that OutputSurface creation
has been async for a while.
Also make the default LTH state invisible to match the scheduler
init state. This also avoids races where we'd otherwise schedule
actions when starting the proxy (i.e. LTH creation time)
which were previously delayed until setLTHClientReady().
BUG=538714,539991
TBR=dtrainor@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1385043002
Cr-Commit-Position: refs/heads/master@{#352742}
This moves the responsibility to call BindToCurrentThread/SetupLock out
of cc::OutputSurface and to the maintainer of the (possibly) shared
context.
OutputSurface now needs to be destroyed on the same thread they
were created. OutputSurface::DetachFromClient() can be used to
destroy any resources that need to be destroyed on the thread
that the OutputSurface has been bound to.
BUG=523411,525811
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1336733002
Cr-Commit-Position: refs/heads/master@{#350409}
Reason for revert:
Broke GPU rasterization on Mac OS; please see https://code.google.com/p/chromium/issues/detail?id=523411#c26 .
I'm really sorry -- I don't know how this got past the CQ.
Original issue's description:
> cc: Implement shared worker contexts.
>
> This moves the responsibility to call BindToCurrentThread/SetupLock out
> of cc::OutputSurface and to the maintainer of the (possibly) shared
> context.
>
> OutputSurface now needs to be destroyed on the same thread they
> were created. OutputSurface::DetachFromClient() can be used to
> destroy any resources that need to be destroyed on the thread
> that the OutputSurface has been bound to.
>
> BUG=523411
> CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
>
> Committed: https://crrev.com/a47ef41ea03d3a5b8965eb700b682ddf8a1f055a
> Cr-Commit-Position: refs/heads/master@{#349274}
TBR=danakj@chromium.org,piman@chromium.org,sievers@chromium.org,reveman@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=523411
Review URL: https://codereview.chromium.org/1356463002
Cr-Commit-Position: refs/heads/master@{#349313}
This moves the responsibility to call BindToCurrentThread/SetupLock out
of cc::OutputSurface and to the maintainer of the (possibly) shared
context.
OutputSurface now needs to be destroyed on the same thread they
were created. OutputSurface::DetachFromClient() can be used to
destroy any resources that need to be destroyed on the thread
that the OutputSurface has been bound to.
BUG=523411
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1336733002
Cr-Commit-Position: refs/heads/master@{#349274}
This renames visible_content_rect to visible_layer_rect. And for
SharedQuadState renames the transforms and rects to no longer refer
to "content" and instead refer to the space the the DrawQuad rects.
R=enne, vmpstr
TBR=dcheng
BUG=413479
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1175113010
Cr-Commit-Position: refs/heads/master@{#335172}
The method is now empty, remove all callsites, which are by far
mostly all tests at this point.
R=enne, vmpstr
BUG=413479
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1180073015
Cr-Commit-Position: refs/heads/master@{#334989}
Make these default to true in LayerTreeSettings so that all unit tests
will use them automatically unless they opt out. Fix all the tests
that crashed with this on, due to having a null cc::TaskGraphRunner.
R=enne, vmpstr
BUG=413479
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
NOTRY=true
Review URL: https://codereview.chromium.org/1177033008
Cr-Commit-Position: refs/heads/master@{#334726}
The occlusion is a draw property, the layer can access it from there
like other draw properties.
Cleanup CL since moving occlusion to draw properties. Too many
AppendQuads overrides... :(
R=enne
BUG=446751
NOTRY=true
Review URL: https://codereview.chromium.org/927783002
Cr-Commit-Position: refs/heads/master@{#316358}
This patch updates LayerImpls to accept Occlusion into AppendQuads
instead of OcclusionTracker. This makes it possible for the layer
to retain a local copy for whatever reason, and restricts the code
from modifying occlusion information in unexpected ways.
R=danakj
Review URL: https://codereview.chromium.org/633773004
Cr-Commit-Position: refs/heads/master@{#298556}
Since bounds includes bounds_delta, which is SizeF, it makes sense to return
the floating point sum of these two values. In call sites broken by the
change, the returned value is converted to Size using ToCeiledSize to
preserve the current snapping behavior, though in most (all?) these cases
the layer bounds are expected to be integral anyway.
BUG=
Review URL: https://codereview.chromium.org/634683003
Cr-Commit-Position: refs/heads/master@{#298439}
In RenderPass use ListContainer for generating DrawQuads and acting as
QuadList.
BUG=344962
Review URL: https://codereview.chromium.org/448303002
Cr-Commit-Position: refs/heads/master@{#296855}
Since QuadSink does not provide more functionatility than passing
through to RenderPass and OcclusionTracker, it can be torn down and
removed. Same is for MockQuadCuller.
This CL follows 302603006, 306683002, 309493002.
BUG=344962
TEST=cc_unittests
Review URL: https://codereview.chromium.org/308193003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279050 0039d316-1c4b-4281-b951-d872f2087c98
MockQuadCuller used to make its own RenderPass and Occlusion Tracker
when nothing is passed in. Now all unittests use MockQC has to create
their own RP and OT, and pass pointers to MockQC. This would make
MockQC mimick QC behavior.
Next CL would use one QuadSink function to replace the hierarchy of
QuadSink, QuadCuller, and MockQuadCuller.
This CL follows 306683002.
BUG=344962
TEST=cc_unittests
Review URL: https://codereview.chromium.org/306683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277099 0039d316-1c4b-4281-b951-d872f2087c98
transform origin.
This is the cc side change that listens to transform origin
instead of anchor point. Blink is already populating both
fields.
BUG=372837
Review URL: https://codereview.chromium.org/295193002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274990 0039d316-1c4b-4281-b951-d872f2087c98
Part of this refactoring was the recognition of a common pattern:
- setConfig + alloc + setImmutable + pass_to_UIResourceBitmap
This CL introduces a direct way on UIResourceBitmap to create such a bitmap, by just specifying its dimensions. This encapsulates internal requirements (e.g. colortype and immutability).
Review URL: https://codereview.chromium.org/197883017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259349 0039d316-1c4b-4281-b951-d872f2087c98
This matches the behavior of the browser and renderer better, and lets us use SharedBitmaps in more tests.
Review URL: https://codereview.chromium.org/202763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258318 0039d316-1c4b-4281-b951-d872f2087c98
This makes the AppendQuads method query occlusion directly and subtract
it from the quads it would create before they are created, skipping
quads that are completely occluded and avoiding a malloc/free for them.
Depends on: https://codereview.chromium.org/201153021/
R=enne
BUG=344962
Review URL: https://codereview.chromium.org/203463015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258228 0039d316-1c4b-4281-b951-d872f2087c98
Any struct of size > 4 bytes should be passed by const ref.
Passing by ref for these structs is faster than passing by value,
especially when invoking function has multiple parameters and some
other scenarios mentioned in the bug.
BUG=159273
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426
Review URL: https://codereview.chromium.org/145313006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247769 0039d316-1c4b-4281-b951-d872f2087c98