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

Issue 903486 link

Starred by 37 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocked on:
issue 590373

Blocking:
issue 898329
issue 905388



Sign in to add a comment

Find a new way to implement rounded corners

Project Member Reported by malaykeshav@chromium.org, Nov 8

Issue description

A lot of animation jank seems to be coming from the use of Mask Layers to create rounded corners. This combined with background blur adds a lot of additional steps in the paint/rendering pipeline.

The performance (fps increase) and memory improvement (tiles dont get discarded and we actually see the content) is quite significant on Nocturne Celeron when rounded corners are removed.


Copying notes from the discussion thread on how rounded corners can be implemented differently: 

Enne->
(1) composite to a render pass, raster a mask, apply mask to render pass texture when drawing (current approach)
(2) composite to a render pass, apply mask to render pass via shader when drawing
(3) apply mask to to individual quads via shader when drawing, assuming no other reasons for a render pass

Approach #3 will have incorrect blending if any of the quads overlap underneath one of the rounded corners. #3 also drops the intermediate texture use.  It seems like something that ui code could opt into, and maybe something we could detect / see how it looks for the web in general if this was something we wanted to explore there as well as an optimization.


Oshima->
It would be great if we can clip the layer instead of using a mask. The clipping can reduce intermediate texture usage and can also support animations(similar to android animation) which are currently blocked because there is no optimal way to achieve it right now.
 
Would you mind running traces with mask layers vs without to see where the main additional costs are on the CPU/GPU?
I have recorded traces with and without rounded corner masks but I am not sure what I am looking for.

Trace categories recorded: benchmark, GPU, toplevel, ui
trace_WithMask.json.gz
6.4 MB Download
trace_WithoutMask.json.gz
6.0 MB Download
I don't see any gpu trace in the WithMask trace.
Could we also add gpu_decoder, gpu.device and gpu.service so we can get an idea of the cost on the GPU.

It'd be also nice if you could close your tabs before taking a trace, we're not interested in your browsing habits. :)
> I don't see any gpu trace in the WithMask trace.
I must have missed it. Uploading them again with gpu, gpu.service, gpu_decoder and gpu.device.
Both traces were run with the same windows open and the same operations were performed. (Record -> Go to Overview mode -> Pick a window -> Swipe down from top-> Pick window that is running Trace -> Stop Tracing)


> It'd be also nice if you could close your tabs before taking a trace, we're not interested in your browsing habits

I needed different webpages to create windows for analyzing window animations that use rounded corners. Used only 4 windows this time.
Actually attaching the trace
trace_WithoutMask.json.gz
3.3 MB Download
trace_WithMask.json.gz
4.3 MB Download
More traces.

Without mask means commenting out a call to ui::Layer::SetLayerMask() whereever the mask layer being set was for generating a rounded corner.
trace_New_WithoutMask.json.gz
4.8 MB Download
trace_New_WithMask.json.gz
4.2 MB Download
Blocking: 905388
Can you summarize the trace results here?
Cc: sammiequon@chromium.org
>The performance (fps increase) and memory improvement (tiles dont get discarded and we actually see the content) is quite significant on Nocturne Celeron when rounded corners are removed.

Would you consider disabling rounded corners until this is worked out?  Why make people suffer, especially since overview mode is the primary way to switch windows in tablet mode?
#10 The rounded corners are currently disabled during most of overview animations.
#11 which CrOS version are they disabled on, because on my i7/16 GB eve running Version 71.0.3578.85 (Official Build) beta (64-bit), overview mode stutters when rendering, and the render is full of errors.  See attached.
IMG_20181206_222230.jpg
3.5 MB View Download
That's known issue and will be addressed separately. While disabling will improve the situation, it won't fix the root cause. (it exceeds GPU memory limit we impose)

Am having an issue with game performance as well due most likely to this same problem.  Samsung Chromebook Plus 2017 version (KEVIN)  Device internals contained in attached PDF.  Multiple feedbacks sent.  
Graphics Lag Issues in Samsung Chromebook Plus.pdf
173 KB Download
In addition here are some further GPU specs relating to poor GPU performance that may assist you.  
gpu2.pdf
101 KB Download
Blocking: 898329

Comment 17 by chrishtr@chromium.org, Today (7 hours ago)

Blockedon: 590373

Sign in to add a comment