drm_hwcomposer: set blending mode to kPreMult for GL output
The correct blending mode for the GL output is actually premult, because
regardless of the original layer blending mode, the result RGB components
are always pre-multiplied with alpha already.
This prevents the result of a SquashAll() from getting multiplied by
alpha twice.
BUG=25838542
TEST=verify the blinking is fixed on the status bar icons
Change-Id: Ie5bbc53110c342576b81818da6069cba201db609
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 4a904b2..f1d925a 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -399,7 +399,7 @@
display_comp->layers().emplace_back();
DrmHwcLayer &pre_comp_layer = display_comp->layers().back();
pre_comp_layer.sf_handle = fb.buffer()->handle;
- pre_comp_layer.blending = DrmHwcBlending::kCoverage;
+ pre_comp_layer.blending = DrmHwcBlending::kPreMult;
pre_comp_layer.source_crop = DrmHwcRect<float>(0, 0, width, height);
pre_comp_layer.display_frame = DrmHwcRect<int>(0, 0, width, height);
ret = pre_comp_layer.buffer.ImportBuffer(fb.buffer()->handle,
@@ -543,7 +543,7 @@
return ret;
}
squash_layer.sf_handle = fb.buffer()->handle;
- squash_layer.blending = DrmHwcBlending::kCoverage;
+ squash_layer.blending = DrmHwcBlending::kPreMult;
squash_layer.source_crop = DrmHwcRect<float>(
0, 0, squash_layer.buffer->width, squash_layer.buffer->height);
squash_layer.display_frame = DrmHwcRect<int>(