Commit 9c8b24c8 authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

Fix direct composition underlays in non root render passes

A number of fixes to make underlays work with non root render passes:
1) Transform clip rect to display space so that it works correctly for
   transformed non-root render passes.
2) Use the RPDQ clip for solid color quad behind the RPDQ.
3) Clip the punch through rect using the video quad's clip rect, and
   propagate the clipped value up the stack.
4) Do not propagate video quad or RPDQ opacities as that doesn't work
   correctly.
5) Do not overwrite underlay rect or occlusion if there are multiple
   underlays in a frame.
6) Lots of comments!

Bug: 843814
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ib62bd3834e7e7856c02d9f304b2b4e4f594fd9cd
Reviewed-on: https://chromium-review.googlesource.com/1087774
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566670}
parent 8d3fbe7c
......@@ -35,7 +35,9 @@ class DrawQuad;
class RenderPassDrawQuad;
class SharedQuadState;
// A list of DrawQuad objects, sorted internally in front-to-back order.
// A list of DrawQuad objects, sorted internally in front-to-back order. To
// add a new quad drawn behind another quad, it must be placed after the other
// quad.
class VIZ_COMMON_EXPORT QuadList : public cc::ListContainer<DrawQuad> {
public:
QuadList();
......
......@@ -102,7 +102,7 @@ class DCLayerOverlayProcessor {
DCLayerOverlayList* ca_layer_overlays);
void ClearOverlayState() {
previous_frame_underlay_rect_ = gfx::Rect();
previous_occlusion_bounding_box_ = gfx::Rect();
previous_frame_underlay_occlusion_ = gfx::Rect();
}
private:
......@@ -136,23 +136,21 @@ class DCLayerOverlayProcessor {
bool is_root,
gfx::Rect* damage_rect,
gfx::Rect* this_frame_underlay_rect,
gfx::Rect* this_frame_underlay_occlusion,
DCLayerOverlay* dc_layer);
gfx::Rect previous_frame_underlay_rect_;
gfx::Rect previous_occlusion_bounding_box_;
gfx::Rect previous_frame_underlay_occlusion_;
gfx::RectF previous_display_rect_;
bool processed_overlay_in_frame_ = false;
// Store information about punch-through rectangles for non-root
// RenderPasses. These rectangles are used to clear the corresponding areas
// in parent renderpasses.
struct PunchThroughRect {
gfx::Rect rect;
gfx::Transform transform_to_target;
float opacity;
};
// Store information about clipped punch-through rects in target space for
// non-root render passes. These rects are used to clear the corresponding
// areas in parent render passes.
base::flat_map<RenderPassId, std::vector<gfx::Rect>>
pass_punch_through_rects_;
base::flat_map<RenderPassId, std::vector<PunchThroughRect>> pass_info_;
DISALLOW_COPY_AND_ASSIGN(DCLayerOverlayProcessor);
};
} // namespace viz
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment