Chromium Code Reviews
DescriptionRounded background image fast path
The current box background paint logic relies on clipping for drawing
rounded-rect background images. This can yield some pathological
rasterization slowdowns on the GPU backend.
In the case where a single image tile covers the whole box (no fancy
tiling involved/required), a more efficient way to draw is to use a
Skia shader and just fill the rounded rect shape (skipping the
unnecessary clip).
This CL implements such an optimization:
1) Introduce a new Image virtual (applyShader) which configures the
paint for filling arbitrary shapes with the image content.
2) Add a new GraphicsContext method for drawing rounded-rect images
(drawRRectImage) using shaders build via #1.
3) Expand BoxPainter's fillFastBottomLayer() fast path to detect
when tiling is not required and use #2 for painting rounded-rect
background images.
This avoids clipping for simple rounded-rect background
images/gradients, and improves GPU rasterization times significantly
in some cases.
In local testing, Animometer/CSS-bouncing-gradient-circles shows a
~26% score improvement with the software backend (300 -> 370) and
a 14X score improvement with Ganesh (27 -> 380).
BUG=603966
R=fs@opera.com,chrishtr@chromium.org,schenney@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel
Committed: https://crrev.com/4c1400381d16b6dcd8921a8f19a2ae9af4aac4cf
Cr-Commit-Position: refs/heads/master@{#395492}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : #Patch Set 8 : #Patch Set 9 : #Patch Set 10 : #Patch Set 11 : #Patch Set 12 : #Patch Set 13 : #Patch Set 14 : #Patch Set 15 : #Patch Set 16 : #Patch Set 17 : #Patch Set 18 : #Patch Set 19 : #Patch Set 20 : test: disable bitmap shaders #Patch Set 21 : #Patch Set 22 : rebased #Patch Set 23 : #
Total comments: 5
Patch Set 24 : review #
Total comments: 9
Patch Set 25 : review #
Total comments: 4
Patch Set 26 : review #
Total comments: 2
Patch Set 27 : todo #Messages
Total messages: 30 (11 generated)
|