Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Issue 311253004: Invert DSF to map from delegated frame to layer space (Closed)

Created:
6 years, 6 months ago by jamesr
Modified:
6 years, 6 months ago
CC:
chromium-reviews, cc-bugs_chromium.org, danakj, piman, scottmg
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276139

Patch Set 1 #

Total comments: 2

Patch Set 2 : fix up math in d_r_l_impl_unittest #

Total comments: 4

Patch Set 3 : use dsf from child, test #

Patch Set 4 : fix win build #

Total comments: 3

Patch Set 5 : address feedback from danakj #

Patch Set 6 : address feedback from danakj #

Patch Set 7 : scale android layer up, remove cc::DRL::SetDisplaySize #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -149 lines) Patch
M cc/layers/delegated_renderer_layer.h View 1 2 3 4 5 6 2 chunks +0 lines, -8 lines 0 comments Download
M cc/layers/delegated_renderer_layer.cc View 1 2 3 4 5 6 2 chunks +0 lines, -9 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.h View 1 2 3 4 5 6 3 chunks +1 line, -6 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.cc View 1 2 3 4 5 6 7 chunks +12 lines, -31 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl_unittest.cc View 1 2 3 17 chunks +67 lines, -56 lines 0 comments Download
M cc/output/delegated_frame_data.h View 1 2 1 chunk +3 lines, -0 lines 1 comment Download
M cc/output/delegated_frame_data.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M cc/output/delegating_renderer.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cc/surfaces/display.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.cc View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 1 2 3 4 5 6 8 chunks +21 lines, -30 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 2 chunks +16 lines, -2 lines 0 comments Download
M content/common/cc_messages.cc View 1 2 3 4 3 chunks +7 lines, -1 line 0 comments Download
M ui/compositor/layer.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 41 (0 generated)
jamesr
This fixes the remaining scaling problems observable on windows with a 1.5 scale factor. There ...
6 years, 6 months ago (2014-06-04 22:46:29 UTC) #1
jamesr
Please double-check carefully, but with the TransformOrigin part removed the rest of the delegated renderer ...
6 years, 6 months ago (2014-06-05 20:54:26 UTC) #2
danakj
On Jun 4, 2014 6:46 PM, <jamesr@chromium.org> wrote: > > Reviewers: enne, > > Message: ...
6 years, 6 months ago (2014-06-05 21:52:51 UTC) #3
chromium-reviews
On Thu, Jun 5, 2014 at 2:52 PM, Dana Jansens <danakj@chromium.org> wrote: > > On ...
6 years, 6 months ago (2014-06-05 21:55:47 UTC) #4
enne (OOO)
https://codereview.chromium.org/311253004/diff/20001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/311253004/diff/20001/cc/layers/delegated_renderer_layer_impl.cc#newcode150 cc/layers/delegated_renderer_layer_impl.cc:150: damage_in_layer.Scale(1.0 / layer_tree_impl()->device_scale_factor()); nit: 1.0 => 1.f, here and ...
6 years, 6 months ago (2014-06-05 23:02:14 UTC) #5
enne (OOO)
PS lgtm
6 years, 6 months ago (2014-06-05 23:02:19 UTC) #6
jamesr
PTAL - this passes the DSF along with the delegated frame data so the parent ...
6 years, 6 months ago (2014-06-05 23:37:34 UTC) #7
enne (OOO)
lgtmstill
6 years, 6 months ago (2014-06-05 23:47:55 UTC) #8
jam
On 2014/06/05 23:47:55, enne wrote: > lgtmstill lgtm security folks should probably change their owners ...
6 years, 6 months ago (2014-06-06 00:13:13 UTC) #9
jamesr
The CQ bit was checked by jamesr@chromium.org
6 years, 6 months ago (2014-06-06 00:14:15 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/311253004/40001
6 years, 6 months ago (2014-06-06 00:15:32 UTC) #11
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 6 months ago (2014-06-06 05:08:15 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-06 06:25:48 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/160411)
6 years, 6 months ago (2014-06-06 06:25:49 UTC) #14
jamesr
The CQ bit was checked by jamesr@chromium.org
6 years, 6 months ago (2014-06-06 06:36:50 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/311253004/60001
6 years, 6 months ago (2014-06-06 06:38:19 UTC) #16
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium ...
6 years, 6 months ago (2014-06-06 09:59:01 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-06 11:52:39 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/mac_chromium_rel/builds/36394)
6 years, 6 months ago (2014-06-06 11:52:39 UTC) #19
danakj
https://codereview.chromium.org/311253004/diff/60001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (left): https://codereview.chromium.org/311253004/diff/60001/cc/layers/delegated_renderer_layer_impl.cc#oldcode201 cc/layers/delegated_renderer_layer_impl.cc:201: gfx::Size display_size = display_size_.IsEmpty() ? bounds() : display_size_; Is ...
6 years, 6 months ago (2014-06-06 16:00:52 UTC) #20
danakj
https://codereview.chromium.org/311253004/diff/60001/cc/trees/layer_tree_host_unittest_delegated.cc File cc/trees/layer_tree_host_unittest_delegated.cc (right): https://codereview.chromium.org/311253004/diff/60001/cc/trees/layer_tree_host_unittest_delegated.cc#newcode489 cc/trees/layer_tree_host_unittest_delegated.cc:489: // Should create a total amount of gfx::Rect(2, 2, ...
6 years, 6 months ago (2014-06-06 17:17:12 UTC) #21
jamesr
The CQ bit was checked by jamesr@chromium.org
6 years, 6 months ago (2014-06-06 18:57:15 UTC) #22
jamesr
On 2014/06/06 16:00:52, danakj wrote: > https://codereview.chromium.org/311253004/diff/60001/cc/layers/delegated_renderer_layer_impl.cc > File cc/layers/delegated_renderer_layer_impl.cc (left): > > https://codereview.chromium.org/311253004/diff/60001/cc/layers/delegated_renderer_layer_impl.cc#oldcode201 > ...
6 years, 6 months ago (2014-06-06 18:59:04 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/311253004/100001
6 years, 6 months ago (2014-06-06 19:01:08 UTC) #24
danakj
Ok, thanks! LGTM
6 years, 6 months ago (2014-06-06 21:41:43 UTC) #25
commit-bot: I haz the power
Change committed as 275544
6 years, 6 months ago (2014-06-06 22:24:41 UTC) #26
acleung1
A revert of this CL has been created in https://codereview.chromium.org/313403005/ by acleung@chromium.org. The reason for ...
6 years, 6 months ago (2014-06-07 03:20:42 UTC) #27
jamesr
On 2014/06/07 03:20:42, acleung1 wrote: > A revert of this CL has been created in ...
6 years, 6 months ago (2014-06-09 17:21:34 UTC) #28
jamesr
Patch set 7 should fix the android issue. aelias@ - could you check it over? ...
6 years, 6 months ago (2014-06-09 23:00:13 UTC) #29
aelias_OOO_until_Jul13
lgtm, thanks for the cleanup.
6 years, 6 months ago (2014-06-09 23:10:44 UTC) #30
danakj
thanks for removing display size :D
6 years, 6 months ago (2014-06-09 23:13:50 UTC) #31
jamesr
The CQ bit was checked by jamesr@chromium.org
6 years, 6 months ago (2014-06-10 00:51:16 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/311253004/120001
6 years, 6 months ago (2014-06-10 00:54:12 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium ...
6 years, 6 months ago (2014-06-10 15:18:11 UTC) #34
danakj
https://codereview.chromium.org/311253004/diff/120001/cc/output/delegated_frame_data.h File cc/output/delegated_frame_data.h (right): https://codereview.chromium.org/311253004/diff/120001/cc/output/delegated_frame_data.h#newcode22 cc/output/delegated_frame_data.h:22: float device_scale_factor; This is already available in CompositorFrameMetadata https://code.google.com/p/chromium/codesearch#chromium/src/cc/output/compositor_frame_metadata.h&l=23
6 years, 6 months ago (2014-06-10 15:44:58 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-10 15:46:15 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/161128)
6 years, 6 months ago (2014-06-10 15:46:16 UTC) #37
jamesr
The CQ bit was checked by jamesr@chromium.org
6 years, 6 months ago (2014-06-10 18:16:05 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/311253004/120001
6 years, 6 months ago (2014-06-10 18:18:34 UTC) #39
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 6 months ago (2014-06-10 18:36:17 UTC) #40
commit-bot: I haz the power
6 years, 6 months ago (2014-06-10 20:57:38 UTC) #41
Message was sent while issue was closed.
Change committed as 276139

Powered by Google App Engine
This is Rietveld 408576698