commit | 9068d6b446f88797d411a080983f36deb83d3892 | [log] [tgz] |
---|---|---|
author | Andres Calderon Jaramillo <andrescj@chromium.org> | Wed Jan 16 01:26:18 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jan 16 01:26:18 2019 |
tree | 4040b1d2db1772bcd05315d726e85c247ad74a8a | |
parent | d2b7ecbbfe7e65a2963e078069bbc44339a5ebc8 [diff] |
Allow translucent shapes to be detected as solid colors. This CL modifies the SolidColorAnalyzer so that a color is not required to be opaque to be considered solid. The motivation is that in the rendering.desktop:blur_rotating_background story, the two blurring foregrounds were being drawn as texture quads because they are translucent. With this CL, they can be drawn as solid color quads thus avoiding textures. The initial change (patchset #3) was relatively simple: remove the alpha == 255 restriction from the IsSolidColor() function and possibly do a manual SrcOver alpha blend in case, e.g., a translucent drawRect is done on top of another drawRect. The blend code was adapted from ui/gfx/color_utils.cc::AlphaBlend(). Unfortunately, this caused some web_tests failures (see patchset #4). Although the differences are not visible, two of the tests are not shown in Gerrit because they could not be rebaselined since they're reftests: compositing/background-color/background-color-alpha.html and virtual/stable/compositing/background-color/background-color-alpha.html. My exploration suggested rounding problems in the alpha premultiplication prior to setting the solid color uniform in the GL shader, so I changed the PremultipliedColor() function in gl_renderer.cc to use a similar premultiplication logic as SkARGB32_Blitter::SkARGB32_Blitter [1], and now all relevant web_tests pass (see patchset #5). After this, there were some unit test failures in cc and viz. I addressed the cc failures by making FakeRasterSource::CreateFilled() return a non-solid-color raster source to ensure that picture layers using it can have tilings. I addressed the viz failure by rebaselining the failed test as the visual difference is very little (there is a difference but it's hard to appreciate in Gerrit). While fixing these failures, I discovered a bug in my previous solid color code changes where a raster source was incorrectly being detected as solid color in certain cases. I fixed that bug and added test cases. All this was done as of patchset #8. [1] https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkBlitter_ARGB32.cpp?l=676-680&rcl=ccb0a307c136760e0b0c33c4f66c3e58a3f98334 Bug: 917058 Test: foregrounds in the story are now drawn as solid color quads. Change-Id: I6d70ccb7c28b356cfbc81a856a17192b6d743933 Reviewed-on: https://chromium-review.googlesource.com/c/1387385 Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org> Reviewed-by: Daniele Castagna <dcastagna@chromium.org> Reviewed-by: enne <enne@chromium.org> Cr-Commit-Position: refs/heads/master@{#622972}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .