Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Issue 555133002: [WIP Experiment] Implement mix-blend-mode in GLRenderer using shaders. (Closed)

Created:
6 years, 3 months ago by rosca
Modified:
6 years, 2 months ago
Reviewers:
danakj, enne (OOO)
CC:
Rik, Erik Dahlström (inactive), mihnea
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

The 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+894 lines, -355 lines) Patch
M cc/output/gl_renderer.h View 1 2 3 4 5 6 4 chunks +66 lines, -37 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 21 chunks +302 lines, -243 lines 1 comment Download
M cc/output/gl_renderer_unittest.cc View 1 1 chunk +21 lines, -19 lines 1 comment Download
M cc/output/program_binding.h View 1 1 chunk +50 lines, -0 lines 1 comment Download
M cc/output/shader.h View 1 2 10 chunks +68 lines, -31 lines 0 comments Download
M cc/output/shader.cc View 1 2 3 4 5 15 chunks +387 lines, -25 lines 1 comment Download

Messages

Total messages: 9 (2 generated)
rosca
On 2014/09/15 14:24:01, Rosca wrote: > mailto:rosca@adobe.com changed reviewers: > + mailto:danakj@chromium.org Hi @danakj, could ...
6 years, 3 months ago (2014-09-15 14:27:42 UTC) #2
danakj
+enne
6 years, 3 months ago (2014-09-22 15:10:25 UTC) #4
rosca
I updated the description with another advantage of this implementation. @enne, could you please let ...
6 years, 3 months ago (2014-09-23 21:04:44 UTC) #5
enne (OOO)
I saw danakj's message earlier when she CC'd me. I will get to this when ...
6 years, 3 months ago (2014-09-23 21:34:24 UTC) #6
enne (OOO)
This is a lot of new shader code. Do the existing blending pixel tests cover ...
6 years, 3 months ago (2014-09-24 22:07:56 UTC) #7
rosca
On 2014/09/24 22:07:56, enne wrote: > This is a lot of new shader code. Do ...
6 years, 2 months ago (2014-09-25 10:50:40 UTC) #8
rosca
6 years, 2 months ago (2014-10-16 16:21:19 UTC) #9

Powered by Google App Engine
This is Rietveld 408576698