DescriptionThe current implementation of blending in GLRenderer uses Ganesh to
blend the content with the backdrop into a temporary texture,
and then uses that temporary texture by replacing the actual content.
In this experiment, blending formulas are added to the existing GL
fragment shaders and blending is done in place, using only one
temporary texture and one pixel copy operation for storing the
backdrop pixels and using it as input for shaders. The current
implementation uses 3 temporary textures and 4 pixel copy
operations per surface per frame.
I tested the performance using animations and blending on two mobile
devices. Using shaders I got 45 fps on a Samsung Galaxy Note 10.1
tabled, versus 10 fps with the Skia based implementation. On a Nexus 5
device, it's 54 fps vs 38 fps.
Another gain in this experiment, besides performance is that rendering
defects we encountered with the skia implementation are not reproducible
using shaders: https://code.google.com/p/chromium/issues/detail?id=403217.
We can also see an image quality improvement with the shader base
implementation. Here is an example that with Chrome Canary looks pixelated,
and with this patch it looks very clear: http://codepen.io/pixelass/full/uqbjr.
With Skia implementation (Chrome Canary), the backdrop is being read using
content's transform, then the inverse transform is applied in order to get
backdrop into the content's space, consequently losing quality.
Patch Set 1 #Patch Set 2 : refactoring and removing old blending implementation #Patch Set 3 : reverting git cl format on shader code #Patch Set 4 : #Patch Set 5 : more blend modes #Patch Set 6 : All blend modes integrated. #Patch Set 7 : fix compile issue on mac #
Total comments: 4
Messages
Total messages: 9 (2 generated)
|