Fix theme background to always be opaque.
We introduced a mistake where if the image was not opaque, the background color was no longer drawn behind it, so on chromeos the chrome header ui could be seen through. This fixes the issue by rearranging the painting some, and improving some performance corner cases while we're here. First, we only need to use SaveLayerWithFlags() when we are blending together 2+ things *that are not opaque*, then want to apply alpha to them together. This is only needed when alpha is < 255, or when we have both |frame_image| and |frame_overlay_image|. Otherwise the background color is opaque, so drawing it first then blending one image into it is equivalent. Then, in both this and the other case, we draw the background color first, then draw the images above it, in order to ensure the bar is opaque. Note also that we use kPlus blending mode when alpha < 255 so that between the active and inactive background colors, they add up to 255 alpha, giving us something opaque. R=estade@chromium.org Bug: 836023 Change-Id: Ibc6b7a3dbec0d9d63b0b07f70a4c17405a3eeec2 Reviewed-on: https://chromium-review.googlesource.com/1050690Reviewed-by:James Cook <jamescook@chromium.org> Reviewed-by:
Evan Stade <estade@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#557265}
Showing
Please register or sign in to comment