On desktop this improves LayerTreeHostPerfTestJsonReader.tenTenSingleThread from ~3702.97 runs/s to ~3786.95 runs/s for about 2%. On a phone we observed about 20% reduction in calcRenderPasses in tracing.
Covered by the occlusion tracker tests as well as LayerTreeHost and TiledLayer tests with occlusion.
BUG=163035
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11583005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173411 0039d316-1c4b-4281-b951-d872f2087c98
[cc] Fold more update calls into updateDrawProperties
Now that we have a clean update system, we can remove the manual
calling of updateRootScrollLayerImplTransform and other similar kinds of "I'm going to do something manually in a half dozen places because I can." This removes some surface area
on LTHI which helps with the LTHI->LTI push.
BUG=155209
R=enne,skyostil
Review URL: https://chromiumcodereview.appspot.com/11529006TBR=nduca@chromium.org
Review URL: https://codereview.chromium.org/11596005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173407 0039d316-1c4b-4281-b951-d872f2087c98
Now that we have a clean update system, we can remove the manual
calling of updateRootScrollLayerImplTransform and other similar kinds of "I'm going to do something manually in a half dozen places because I can." This removes some surface area
on LTHI which helps with the LTHI->LTI push.
BUG=155209
R=enne,skyostil
Review URL: https://chromiumcodereview.appspot.com/11529006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173406 0039d316-1c4b-4281-b951-d872f2087c98
All cc test harnesses now live in the cc namespace. Any cc unittest or
pixeltest itself is in an anonymous namespace under cc. This patch removes all
instances of the WebKitTest namespace from cc.
R=jamesr@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11474050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173391 0039d316-1c4b-4281-b951-d872f2087c98
Many cc tests don't call calcDrawProperties and so would have incorrect
content bounds on layers if didUpdateBounds were to be removed.
This patch does not address all of the tests broken by removing that
function, but fixes a large number of them.
R=danakj@chromium.org
BUG=166023
Review URL: https://chromiumcodereview.appspot.com/11573019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173390 0039d316-1c4b-4281-b951-d872f2087c98
PictureLayerImpl gets the ability to sync a tiling from active
to pending tree when it gets created so that layers can share tiles.
A few functions are added to make this possible.
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11574026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173366 0039d316-1c4b-4281-b951-d872f2087c98
This change allows layer impls to manipulate their content scale. This will
allow PictureLayerImpl to pick some contents scale based on the scales of their
tilings, rather than being stuck at the contents scale of its PictureLayer.
This also de-virtualizes all of the content scale/bounds functions and instead
allows a layer to manipulate its draw properties in response to a bounds or
contents scale change.
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11503005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173365 0039d316-1c4b-4281-b951-d872f2087c98
This makes it easier to diagnose when caches are hitting or missing (and why) in
traces. It's fairly verbose, but I've been patching it in locally for long enough
that it seems generally useful.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11570036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173359 0039d316-1c4b-4281-b951-d872f2087c98
This is just a quick refactor that will make adding a pending tree
easier that I thought I'd land separately.
R=jamesr@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11583009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173351 0039d316-1c4b-4281-b951-d872f2087c98
This patch introduces a new feature to the compositor:
- A setting to enable cleaning the framebuffer, disabled by default. This prevents destroying data below us when rendering non-rectangular views (e.g. during a rotation).
A second required feature will be added by a later patch:
- A device scissor rect that intersects any scissor calculation. Used to ensure we never render outside where the Android View System tells us.
There are also some issues with the Android View side regarding the restoration of the GL state. This patch introduces a temporary workaround by reading and manually restoring the state changed by the compositor. This will go out as soon as the problem is fixed in the Android side.
BUG=161409,154180
Review URL: https://chromiumcodereview.appspot.com/11316310
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173324 0039d316-1c4b-4281-b951-d872f2087c98
manager identify themselves as managed to the GPU memory manager
through a GL texture parameter.
This allows the GPU memory manager to get very precise statistics
on evictable memory usage with minimal overhead.
BUG=164947
Review URL: https://codereview.chromium.org/11548052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173252 0039d316-1c4b-4281-b951-d872f2087c98
Pools were used in the past and were planned to be used to
call deleteOwnedResources. We have moved the responsibility
of deleting resources to the structure that created them
(for example, the PrioritizedResourceManager now deletes
contents textures, instead of calling deleteOwnedResources).
BUG=164947
Review URL: https://codereview.chromium.org/11578019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173212 0039d316-1c4b-4281-b951-d872f2087c98
When moving a composited layer around the screen that requires a render pass,
it's not all that unusual for the required size to be slightly different from
frame to frame. This lets us use an oversized texture as the framebuffer
attachment.
BUG=161868
Review URL: https://chromiumcodereview.appspot.com/11420079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173112 0039d316-1c4b-4281-b951-d872f2087c98
This is a prerequisite to two LayerTreeImpls, as PictureLayerImpls in the
active tree may need to ask about their pending tree sibilings with the
same id. Once this lands, functionality like findScrollingLayerbyId can
be wrapped into this too.
LayerImpl now registers itself with its tree on creation and destruction.
As there are now asserts that a given id is not already in use, a number
of tests have been updated to not duplicate layer ids.
There doesn't technically need to be an unregister step, but as LayerImpl
doesn't necessarily have to be in the LayerImpl tree rooted in the
LayerTreeImpl, this unregister check will blow up if anybody has a layer
outliving their registered tree (which is bad).
As LayerImpl has single ownership, it's impossible to assign the same
non-NULL replica or mask to a layer, so the LayerImpl unit tests are
updated to not test this anymore. Masks and replicas are also modified
to keep their id in sync with their pointer during tree synchronization
to prevent asserts about duplicate ids.
R=danakj@chromium.org
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11575018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173110 0039d316-1c4b-4281-b951-d872f2087c98
Tile pointers are left in tiles_that_need_to_be_rasterized_ vector
until ManageTiles() or AssignGpuMemoryToTiles() are called.
BUG=165852
Review URL: https://chromiumcodereview.appspot.com/11549038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173039 0039d316-1c4b-4281-b951-d872f2087c98
Removes the bindings to uniforms from initalization time to draw time
for batched drawing.
BUG=164540
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11506019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172916 0039d316-1c4b-4281-b951-d872f2087c98
- Text AA settings are not adjusted during animation to avoid repaints.
- Renamed Layer::useLCDText to Layer::canUseLCDText.
BUG=100666
Review URL: https://chromiumcodereview.appspot.com/11360093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172842 0039d316-1c4b-4281-b951-d872f2087c98
This folds the 4 floats together into a single parameter to be slightly easier to manage, but doesn't change the logic.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11543013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172825 0039d316-1c4b-4281-b951-d872f2087c98
Due to my lack of git know-how this ended up being the entire clipping patch plus my last validation rather than just a few line fix.
Given that the last one got reverted as a test anyway perhaps this is just as well?
BUG=165237
Review URL: https://chromiumcodereview.appspot.com/11481004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172788 0039d316-1c4b-4281-b951-d872f2087c98
Instead of doing one search over the render surface layer list,
find the layer that the points hits first and then walk up the layer hierarchy
testing for a hit in touch event handler regions. This enables us to use one
touch event handlere region in the root layer.
BUG=135818
Review URL: https://chromiumcodereview.appspot.com/11534024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172778 0039d316-1c4b-4281-b951-d872f2087c98
This path needs to be turned off until its correctness issues are fixed.
NOTRY=true
R=nduca@chromium.org
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11553033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172697 0039d316-1c4b-4281-b951-d872f2087c98
Asymptotically, the recursive algorithm in calculateDrawTransforms is O(n^2)
because of a secondary recursion that occurs for every layer in
subtreeShouldRenderToSeparateSurface.
This patch moves the internal secondary recursion into a pre-walk, caching
the meaningful result of that recursion, so that the algorithm is O(2 * n).
Review URL: https://codereview.chromium.org/11419284
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172682 0039d316-1c4b-4281-b951-d872f2087c98
Pulled settings & debugstate to their own files to reduce header coupling, which bit me a few times on this patch [lthi needs lth, lti needs lthi for settings, etc].
NOTRY=true
BUG=155209
R=enne
Review URL: https://chromiumcodereview.appspot.com/11529003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172635 0039d316-1c4b-4281-b951-d872f2087c98
The PictureLayerTiling iterator used to stop when it hit a null tile
rather than iterating through null tiles. So, some invalidations were
ignored because the iterator would hit a null tile from a previous
invalidation rect on the same frame and abort.
This is fixed by making the PictureLayerTiling iterator walk over all i,
j pairs, regardless of whether there is a tile there or not. The
PictureLayerTilingSet iteration is also made robust to this possibility.
R=nduca@chromium.org
BUG=165246, 165336
Review URL: https://chromiumcodereview.appspot.com/11555002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172519 0039d316-1c4b-4281-b951-d872f2087c98
This patch avoids even more math. cc_perftests on linux desktop improved by about 3-4%.
(0) Skip applying the layer's anchorPoint + transform + inverseAnchorPoint if the layer's transform was identity.
(1) The surface clipRect, projected from ancestor space to current surface
space, is now cached in calcDrawTransforms so it only needs to be computed
once, instead of onces for every layer that contributes to the surface.
(2) The layer's bounds, transformed into target surface space, are passed into
calculateVisibleContentRect, so that this function does not need to redo the
mapClippedRect computation unnecessarily.
(3) The early exit logic was made more aggressive, to early-out as soon as we
realize that none of the layer's drawProperties need to be computed.
BUG=163769
Review URL: https://codereview.chromium.org/11534006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172475 0039d316-1c4b-4281-b951-d872f2087c98
Previously, we would only set the tiling set bounds post-calcDraw, which
means that invalidations that came in during the commit would get dropped
because they were outside the content bounds of each tiling. Fix this by
explicitly updating bounds during the commit prior to invalidation.
This fixes offscreen garbage caused by layer resizing when viewing a
directory with impl-side painting.
The didUpdateBounds function is in line with the direction of the patch
here: https://codereview.chromium.org/11503005/ and can just be made
virtual in the future.
R=nduca@chromium.org
BUG=165246
Review URL: https://chromiumcodereview.appspot.com/11516022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172372 0039d316-1c4b-4281-b951-d872f2087c98
Directly composited images are recorded into an SkPicture just like normal
content. This also means that (at the moment) they will be treated like
normal content, such as getting low-res versions. There will need to be
some future follow-up to make sure that tiny images that end up large
on page don't take up unnecessary GPU memory.
The only bad part about this path is that changing a layer's bounds forces the
content to need to be re-recorded and re-rasterized, as there's an assumption
that the composited image fills its entire bounds. This could be fixed in the
future by adding another layer (haha) of indirection.
R=nduca@chromium.org
BUG=163998
Review URL: https://chromiumcodereview.appspot.com/11516005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172241 0039d316-1c4b-4281-b951-d872f2087c98
The time-based graphing of the fps values made the graph move on too quickly on static pages and provided little value in general. This change switches back to a frame based graphing.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11280312
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172235 0039d316-1c4b-4281-b951-d872f2087c98
> This patch makes quad-clipping to a scissor window an explicit operation at quad-generation time. If the transform for the quad is a scale and or a transform clipping is a simple bounding box intersection and uv-recomputation.
>
> BUG=161871
>
>
> Review URL: https://chromiumcodereview.appspot.com/11418297TBR=whunt@chromium.org
BUG=164997
Review URL: https://codereview.chromium.org/11517007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172152 0039d316-1c4b-4281-b951-d872f2087c98
Previously, calcDrawEtc was coupled to drawLayers. Immediately before drawing,
it would get called to update layer state based on any impl-side input that
came in after the commit.
Impl-side painting needs to update layer transforms / visible content rect
state prior to rasterizing contents. And, if input comes in, it might also
need to re-update prior to drawing. LayerTreeHostImpl then gets a
needsUpdateLayers() flag, and updateLayers() (which calls calcDraw) is a no-op
if nothing has changed on the tree. Additionally, the calculate render surface
layer list is persisted since the last updateLayers() call.
The LayerTreeHostImpl now sets the needsUpdate flag after commit, scroll, pinch
zoom, and animation. These are the easy ones.
Unfortunately, this creates an amazing foot gun where you can manipulate the
impl tree on the impl thread and updateLayers won't get called, because the
needsUpdate flag hasn't been called explicitly. This mostly happens in tests,
but could happen elsewhere. To fix this, setFoo calls on LayerImpl now calls
setNeedsUpdate() on its host.
BUG=155209
Review URL: https://chromiumcodereview.appspot.com/11447028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172005 0039d316-1c4b-4281-b951-d872f2087c98
> With this patch we accomplish the following:
> 1. layer animation controllers are ref counted (so they can be shared by the two impl trees)
> 2. the layer tree hosts now own a list of active animation controllers. This allows for a couple of nice things
> __a. Ticking the animation controllers no longer requires a tree walk
> __b. We will be able to support ticking of animation controllers for layers that are not yet added to the layer tree. (Support coming in a future patch).
> 3. animation controllers register and unregister themselves from their respective layer tree host's list when they have an animation to tick.
>
> BUG=162111
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=171714TBR=vollick@chromium.org
BUG=
Review URL: https://codereview.chromium.org/11491003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171981 0039d316-1c4b-4281-b951-d872f2087c98
This can't get used yet until we have a pending->active tree commit, but I
wanted to land the flag on layers first so that we could argue about the name.
R=nduca@chromium.org
BUG=164993
Review URL: https://chromiumcodereview.appspot.com/11475054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171974 0039d316-1c4b-4281-b951-d872f2087c98
Previously there was a content space vs. layer space mixup. cc::Tile had a
member variable that was labeled rect_in_layer_space, but the tilings were
making a content space rect. It's actually impossible to have an int rect in
layer space for most content spaces, so this got renamed to just be
content_space rect.
The actual bug was that this rect was being used to check if a given picture's
layer rect intersected it, so as soon as you got over bounds() / content_scale
away from the origin, the tile was getting nothing rastered to it and whatever
memory was in the canvas was being used, which happened to be old tiles.
R=aelias@chromium.org
BUG=164750
Review URL: https://chromiumcodereview.appspot.com/11466032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171964 0039d316-1c4b-4281-b951-d872f2087c98
to JSON format which can then be loaded and used from our cc_perftests.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11446076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171963 0039d316-1c4b-4281-b951-d872f2087c98
It's a skeleton class that can be initialized so that we can test with it.
Tests:
LayerTreeHostTest.PartialUpdatesWithDelegatingRendererAndGLContent
LayerTreeHostTest.PartialUpdatesWithDelegatingRendererAndSoftwareContent
LayerTreeHostImplTest.partialSwapReceivesDamageRect
R=piman
BUG=146080
Review URL: https://codereview.chromium.org/11464007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171927 0039d316-1c4b-4281-b951-d872f2087c98