New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 731263 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

LayerTreeHost surface references wrong with multiple SurfaceLayers for one SurfaceId

Project Member Reported by kylec...@chromium.org, Jun 8 2017

Issue description

In LayerTreeHost there is a flat_set<SurfaceId> for all SurfaceIds that a SurfaceLayer exists for. This flat_set is used to build the list of referenced surfaces for the resulting CompositorFrame.

This set doesn't work correctly when there are multiple SurfaceLayers with the same SurfaceId. This happens with CrOS window minimize/maximize animations.

For example, at the start of say maximize the SurfaceLayer for |old_surface_id| is cloned. There are two SurfaceLayers with the same SurfaceId at this point. The resized window has a new SurfaceId |new_surface_id|. One of the SurrfaceLayers is modified to use |new_surface_id|, which calls LayerTreeHost::RemoveSurfaceLayerId(old_surface_id) and then LayerTreeHost::AddSurfaceLayerId(new_surface_id). This removes |old_surface_id| from the set referenced surfaces, even though a SurfaceLayer still exists for it and SurfaceDrawQuad is produced for it.

I'll update LayerTreeHost to keep track of the number of surface layers for a SurfaceId (eg flat_set<SurfaceId> becomes flat_map<SurfaceId, int)>).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/396d4f45cd8c778059c79493b26701469576c3b5

commit 396d4f45cd8c778059c79493b26701469576c3b5
Author: kylechar <kylechar@chromium.org>
Date: Mon Jun 12 20:47:08 2017

Fix LayerTreeHost tracking SurfaceIds.

LayerTreeHost didn't keep track of the number of surface layers for each
SurfaceId. When there are multiple SurfaceLayers for the same SurfaceId
both SurfaceLayerIds() and needs_surface_ids_sync() were potentially
wrong.

Make LayerTreeHost track the number of layers for each SurfaceId. Also
add tests for this case.

Bug:  731263 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ifd6efe1b02c9ec4f728490b4487756b5319b681f
Reviewed-on: https://chromium-review.googlesource.com/529566
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478749}
[modify] https://crrev.com/396d4f45cd8c778059c79493b26701469576c3b5/cc/layers/surface_layer_unittest.cc
[modify] https://crrev.com/396d4f45cd8c778059c79493b26701469576c3b5/cc/trees/layer_tree_host.cc
[modify] https://crrev.com/396d4f45cd8c778059c79493b26701469576c3b5/cc/trees/layer_tree_host.h

Status: Fixed (was: Started)

Comment 3 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment