summaryrefslogtreecommitdiffstats
path: root/cc/output/delegating_renderer.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 20:57:33 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 20:57:33 +0000
commita168bf1a8d5075a99c6ee9b1bbe7ed03c0386fc7 (patch)
treece391199361212d1eb4d8fc41161349e21c6093d /cc/output/delegating_renderer.cc
parent2b38b733e5db9551766847da783f1b93e0fafd1e (diff)
downloadchromium_src-a168bf1a8d5075a99c6ee9b1bbe7ed03c0386fc7.zip
chromium_src-a168bf1a8d5075a99c6ee9b1bbe7ed03c0386fc7.tar.gz
chromium_src-a168bf1a8d5075a99c6ee9b1bbe7ed03c0386fc7.tar.bz2
Invert DSF to map from delegated frame to layer space
The size of the frame data from a delegated source will not in general match up exactly with the delegated layer's bounds. Frame sizes and layer bounds are both expressed as integers, but frame sizes are in physical pixels and layer bounds are in device-independent pixels. If the device scale is not an integer, there may not be an exact mapping between the two spaces. For instance, if the layer size is 105 x 211 and the device scale is 1.5, the delegated content is responsible for filling 157.5 x 316.5 physical pixels in the final output. This isn't really possible so what actually happens is the delegated renderer produces a frame with a physical size of 158 x 317 pixels and sends that up to the DRLI. To map this frame into physical space, the DRLI should apply the inverse of the device scale factor to reflect that the frame covers 105.333 x 211.3333 logical pixels. Before this patch, DRLI would attempt to scale the frame by (105/158, 211/317) resulting in the frame being scaled down non-uniformly to try to make 158 x 317 pixels fit into a 157.5 x 316.6 space. This scaling looks bad and ends up mapping pixels partially outside of the layer's logical bounds into the layer's logical bounds. BUG=370074 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275544 Review URL: https://codereview.chromium.org/311253004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/delegating_renderer.cc')
-rw-r--r--cc/output/delegating_renderer.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
index e3b7c68..68c29e5 100644
--- a/cc/output/delegating_renderer.cc
+++ b/cc/output/delegating_renderer.cc
@@ -93,6 +93,7 @@ void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData);
DelegatedFrameData& out_data = *delegated_frame_data_;
+ out_data.device_scale_factor = device_scale_factor;
// Move the render passes and resources into the |out_frame|.
out_data.render_pass_list.swap(*render_passes_in_draw_order);