Commit 4bf9d01d authored by Dongseong Hwang's avatar Dongseong Hwang Committed by Commit Bot

viz: Fix wrong uv_rect calculation

CL:1045256 calculates |uv_rect| of the primary plane in wrong way. It causes
drmModeAtomicAddProperty failure. This CL fixes it.

BUG=896945

Change-Id: I6e914707cb961e8294e8ddd160b75e48ae5a2b64
Reviewed-on: https://chromium-review.googlesource.com/c/1291590
Commit-Queue: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: default avatarDongseong Hwang <dongseong.hwang@intel.com>
Cr-Commit-Position: refs/heads/master@{#601392}
parent f9b3baff
...@@ -279,9 +279,11 @@ void OverlayProcessor::EliminateOrCropPrimary( ...@@ -279,9 +279,11 @@ void OverlayProcessor::EliminateOrCropPrimary(
// Sometimes the content quads extend past primary->display_rect, so first // Sometimes the content quads extend past primary->display_rect, so first
// clip the content_rect to that. // clip the content_rect to that.
content_rect.Intersect(primary->display_rect); content_rect.Intersect(primary->display_rect);
primary->uv_rect = gfx::ScaleRect(content_rect, DCHECK_NE(0, primary->display_rect.width());
primary->display_rect.width(), DCHECK_NE(0, primary->display_rect.height());
primary->display_rect.height()); primary->uv_rect =
gfx::ScaleRect(content_rect, 1. / primary->display_rect.width(),
1. / primary->display_rect.height());
primary->display_rect = content_rect; primary->display_rect = content_rect;
candidate_list->push_back(*primary); candidate_list->push_back(*primary);
......
...@@ -1913,6 +1913,7 @@ TEST_F(UnderlayTest, PrimaryPlaneOverlayIsTransparentWithUnderlay) { ...@@ -1913,6 +1913,7 @@ TEST_F(UnderlayTest, PrimaryPlaneOverlayIsTransparentWithUnderlay) {
OverlayCandidateList candidate_list; OverlayCandidateList candidate_list;
OverlayCandidate candidate; OverlayCandidate candidate;
candidate.display_rect = gfx::RectF(pass->output_rect);
candidate.use_output_surface_for_resource = true; candidate.use_output_surface_for_resource = true;
candidate.is_opaque = true; candidate.is_opaque = true;
candidate_list.push_back(candidate); candidate_list.push_back(candidate);
...@@ -2168,6 +2169,7 @@ TEST_F(UnderlayCastTest, PrimaryPlaneOverlayIsTransparentWithUnderlay) { ...@@ -2168,6 +2169,7 @@ TEST_F(UnderlayCastTest, PrimaryPlaneOverlayIsTransparentWithUnderlay) {
OverlayCandidateList candidate_list; OverlayCandidateList candidate_list;
OverlayCandidate candidate; OverlayCandidate candidate;
candidate.display_rect = gfx::RectF(pass->output_rect);
candidate.use_output_surface_for_resource = true; candidate.use_output_surface_for_resource = true;
candidate.is_opaque = true; candidate.is_opaque = true;
candidate_list.push_back(candidate); candidate_list.push_back(candidate);
......
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