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

Issue 15579002: Implement transform/clip support for Android WebView. (Closed)

Created:
7 years, 7 months ago by aelias_OOO_until_Jul13
Modified:
7 years, 6 months ago
Reviewers:
danakj, joth, enne (OOO), piman
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, cc-bugs_chromium.org, joth, boliu, benm (inactive), shawnsingh, danakj, trchen, jamesr
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Implement transform/clip support for Android WebView. Transforms are applied above the root-layer. I fixed LTHCommon to forward root-layer transforms to sublayers, as the RenderSurface-based logic was previously clearing transforms and copying over only the scale portion. The clip rect is treated as the viewport for the purposes of DrawQuads and Renderer (this is required to avoid awful performance when the WebView is much larger than the screen). Because y-flipping the clip rect depends on knowledge of the true surface size, I also needed to add a new OutputSurface::SurfaceSize() getter and refactored viewport size throughout the Renderers to separate render-pass draw rect, glViewport rect, and surface size. Scale and translate transforms work with this patch, but rotation is still broken. New tests: LayerTreeHostCommonTest.TransformAboveRootLayer, GLRendererTest2.ScissorAndViewportWithinNonreshapableSurface, RendererPixelTest/2* and 3* NOTRY=true BUG=230463 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204650

Patch Set 1 #

Patch Set 2 : Rebase to 201857 #

Patch Set 3 : Add GL support and clean up #

Total comments: 4

Patch Set 4 : Fix GL viewport for renderpasses #

Patch Set 5 : Address joth's code review #

Total comments: 4

Patch Set 6 : Move scissor y-flip to DirectRenderer and fix LTHC root-layer transforms #

Patch Set 7 : Fix unit test #

Patch Set 8 : Add tests #

Total comments: 22

Patch Set 9 : Address code review comments #

Patch Set 10 : Add test coverage for root layer transform being correct #

Patch Set 11 : Affix fixed-pos to root layer by default and bring back constraints test #

Patch Set 12 : Make MailboxOutputSurface use surface_size_ #

Total comments: 4

Patch Set 13 : Address Antoine's code review comments #

Total comments: 9

Patch Set 14 : Fix readback and clean up scissor code #

Patch Set 15 : Add SoftwareRenderer offset readback test #

Patch Set 16 : Add ExpandedViewport versions of RendererPixelTest suite #

Patch Set 17 : Rebase to 204460 #

Patch Set 18 : Fix compile #

Total comments: 7

Patch Set 19 : Apply nits #

Patch Set 20 : Turn on fuzzy comparator for new SoftwareRenderer tests #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+776 lines, -280 lines) Patch
M cc/layers/contents_scaling_layer_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/layer_iterator_unittest.cc View 1 2 3 4 5 3 chunks +3 lines, -0 lines 0 comments Download
M cc/layers/layer_position_constraint_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +19 lines, -22 lines 0 comments Download
M cc/layers/solid_color_layer_impl_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/tiled_layer_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/output/direct_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +23 lines, -8 lines 0 comments Download
M cc/output/direct_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +49 lines, -29 lines 2 comments Download
M cc/output/gl_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +2 lines, -5 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 12 chunks +28 lines, -34 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 12 chunks +91 lines, -20 lines 0 comments Download
M cc/output/output_surface.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M cc/output/output_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +19 lines, -5 lines 0 comments Download
M cc/output/output_surface_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -0 lines 0 comments Download
M cc/output/output_surface_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M cc/output/renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -7 lines 0 comments Download
M cc/output/renderer_pixeltest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +12 lines, -1 line 0 comments Download
M cc/output/software_output_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -4 lines 0 comments Download
M cc/output/software_renderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +3 lines, -4 lines 0 comments Download
M cc/output/software_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +14 lines, -13 lines 0 comments Download
M cc/output/software_renderer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 11 chunks +21 lines, -18 lines 0 comments Download
M cc/test/fake_output_surface.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M cc/test/pixel_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +84 lines, -1 line 0 comments Download
M cc/test/pixel_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +67 lines, -9 lines 0 comments Download
M cc/trees/damage_tracker_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_common.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_common.cc View 1 2 3 4 5 6 7 8 9 10 11 chunks +55 lines, -58 lines 0 comments Download
M cc/trees/layer_tree_host_common_unittest.cc View 1 2 3 4 5 6 7 8 9 54 chunks +168 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +25 lines, -4 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +21 lines, -7 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -1 line 0 comments Download
M cc/trees/occlusion_tracker_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_output_surface.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_output_surface.cc View 1 2 3 4 5 3 chunks +27 lines, -17 lines 0 comments Download
M content/renderer/gpu/mailbox_output_surface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/gpu/mailbox_output_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +9 lines, -7 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
aelias_OOO_until_Jul13
Hi Enne, PTAL. This is getting clean and functional enough to start reviewing.
7 years, 7 months ago (2013-05-25 02:34:55 UTC) #1
joth
Thanks for handling this aelias! https://codereview.chromium.org/15579002/diff/5001/cc/output/output_surface_client.h File cc/output/output_surface_client.h (right): https://codereview.chromium.org/15579002/diff/5001/cc/output/output_surface_client.h#newcode19 cc/output/output_surface_client.h:19: virtual void SetDeviceTransformAndClip(gfx::Transform transform, ...
7 years, 7 months ago (2013-05-25 02:56:40 UTC) #2
aelias_OOO_until_Jul13
OK, all done. On 2013/05/25 02:56:40, joth wrote: > content/renderer/android/synchronous_compositor_output_surface.cc:199: > clipFlipY(clip, view_size)); > any ...
7 years, 7 months ago (2013-05-25 03:33:39 UTC) #3
joth
lgtm for content/renderer/android (and re. the other comments I made)
7 years, 7 months ago (2013-05-26 00:24:39 UTC) #4
enne (OOO)
+shawnsingh, danakj for transform-related changes FYI Is it the case that this offset is relative ...
7 years, 6 months ago (2013-05-28 18:26:19 UTC) #5
aelias_OOO_until_Jul13
On 2013/05/28 18:26:19, enne wrote: > Is it the case that this offset is relative ...
7 years, 6 months ago (2013-05-28 20:49:33 UTC) #6
enne (OOO)
On 2013/05/28 20:49:33, aelias wrote: > On 2013/05/28 18:26:19, enne wrote: > > Is it ...
7 years, 6 months ago (2013-05-28 21:15:51 UTC) #7
aelias_OOO_until_Jul13
OK, we chatted a bit more about fixed-pos and agreed they should stay attached to ...
7 years, 6 months ago (2013-05-28 22:21:54 UTC) #8
aelias_OOO_until_Jul13
Also: On 2013/05/28 18:26:19, enne wrote: > I know you don't want to do this ...
7 years, 6 months ago (2013-05-29 06:35:13 UTC) #9
aelias_OOO_until_Jul13
On 2013/05/29 06:35:13, aelias wrote: > With respect to the glViewport/windowMatrix changes, they could be ...
7 years, 6 months ago (2013-05-29 07:00:03 UTC) #10
enne (OOO)
What are your thoughts about testing these changes? What do you think about unit tests ...
7 years, 6 months ago (2013-05-29 20:34:12 UTC) #11
aelias_OOO_until_Jul13
On 2013/05/29 20:34:12, enne wrote: > What are your thoughts about testing these changes? What ...
7 years, 6 months ago (2013-05-29 21:13:35 UTC) #12
enne (OOO)
On 2013/05/29 21:13:35, aelias wrote: > On 2013/05/29 20:34:12, enne wrote: > > What are ...
7 years, 6 months ago (2013-05-29 21:33:15 UTC) #13
aelias_OOO_until_Jul13
On 2013/05/29 21:33:15, enne wrote: > > Scale transforms can be applied at the top ...
7 years, 6 months ago (2013-05-29 21:51:12 UTC) #14
joth
https://codereview.chromium.org/15579002/diff/5003/content/renderer/android/synchronous_compositor_output_surface.cc File content/renderer/android/synchronous_compositor_output_surface.cc (right): https://codereview.chromium.org/15579002/diff/5003/content/renderer/android/synchronous_compositor_output_surface.cc#newcode195 content/renderer/android/synchronous_compositor_output_surface.cc:195: gfx::Size view_size, view_size -> surface_size or device_size ?
7 years, 6 months ago (2013-06-01 01:28:20 UTC) #15
aelias_OOO_until_Jul13
PTAL, I added two tests and restructured as discussed offline. I think this should be ...
7 years, 6 months ago (2013-06-04 07:16:14 UTC) #16
jamesr
On 2013/06/04 07:16:14, aelias wrote: > Adding jamesr@ for trivial OWNERS review of webkit/renderer/. enne@ ...
7 years, 6 months ago (2013-06-04 07:20:02 UTC) #17
aelias_OOO_until_Jul13
On 2013/06/04 07:20:02, jamesr wrote: > enne@ has OWNERS there as well, are you still ...
7 years, 6 months ago (2013-06-04 07:24:37 UTC) #18
danakj
On Tue, Jun 4, 2013 at 3:16 AM, <aelias@chromium.org> wrote: > PTAL, I added two ...
7 years, 6 months ago (2013-06-04 13:59:34 UTC) #19
enne (OOO)
https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc File cc/layers/layer_position_constraint_unittest.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc#oldcode1034 cc/layers/layer_position_constraint_unittest.cc:1034: ScrollCompensationForFixedPositionLayerThatHasNoContainer) { What do you mean by "we don't ...
7 years, 6 months ago (2013-06-04 17:26:03 UTC) #20
danakj
https://codereview.chromium.org/15579002/diff/44001/cc/trees/layer_tree_host_common.cc File cc/trees/layer_tree_host_common.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/trees/layer_tree_host_common.cc#oldcode1129 cc/trees/layer_tree_host_common.cc:1129: DCHECK_EQ(render_surface_sublayer_scale.x(), Can these checks stay in the IsRootLayer() block? ...
7 years, 6 months ago (2013-06-04 17:26:39 UTC) #21
danakj
https://codereview.chromium.org/15579002/diff/44001/cc/trees/layer_tree_host_common.cc File cc/trees/layer_tree_host_common.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/trees/layer_tree_host_common.cc#oldcode1129 cc/trees/layer_tree_host_common.cc:1129: DCHECK_EQ(render_surface_sublayer_scale.x(), On 2013/06/04 17:26:40, danakj wrote: > Can these ...
7 years, 6 months ago (2013-06-04 17:31:30 UTC) #22
aelias_OOO_until_Jul13
https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc File cc/layers/layer_position_constraint_unittest.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc#oldcode1034 cc/layers/layer_position_constraint_unittest.cc:1034: ScrollCompensationForFixedPositionLayerThatHasNoContainer) { On 2013/06/04 17:26:03, enne wrote: > What ...
7 years, 6 months ago (2013-06-04 17:54:19 UTC) #23
danakj
https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc File cc/layers/layer_position_constraint_unittest.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc#oldcode1034 cc/layers/layer_position_constraint_unittest.cc:1034: ScrollCompensationForFixedPositionLayerThatHasNoContainer) { On 2013/06/04 17:54:20, aelias wrote: > On ...
7 years, 6 months ago (2013-06-04 18:02:50 UTC) #24
aelias_OOO_until_Jul13
PTAL, all comments addressed. https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc File cc/layers/layer_position_constraint_unittest.cc (left): https://codereview.chromium.org/15579002/diff/44001/cc/layers/layer_position_constraint_unittest.cc#oldcode1034 cc/layers/layer_position_constraint_unittest.cc:1034: ScrollCompensationForFixedPositionLayerThatHasNoContainer) { On 2013/06/04 18:02:50, ...
7 years, 6 months ago (2013-06-04 22:18:26 UTC) #25
aelias_OOO_until_Jul13
Adding Antoine for OWNERS review of content/renderer/gpu/mailbox_output_surface.cc. To give some background, I needed to make ...
7 years, 6 months ago (2013-06-05 00:03:29 UTC) #26
piman
https://codereview.chromium.org/15579002/diff/69001/cc/output/output_surface.cc File cc/output/output_surface.cc (right): https://codereview.chromium.org/15579002/diff/69001/cc/output/output_surface.cc#newcode120 cc/output/output_surface.cc:120: if (context3d_) nit: brackets needed. https://codereview.chromium.org/15579002/diff/69001/cc/output/output_surface.h File cc/output/output_surface.h (right): ...
7 years, 6 months ago (2013-06-05 00:52:07 UTC) #27
aelias_OOO_until_Jul13
Agreed on the fragility, filed http://crbug.com/246861 to track. https://codereview.chromium.org/15579002/diff/69001/cc/output/output_surface.h File cc/output/output_surface.h (right): https://codereview.chromium.org/15579002/diff/69001/cc/output/output_surface.h#newcode115 cc/output/output_surface.h:115: float ...
7 years, 6 months ago (2013-06-05 00:59:02 UTC) #28
piman
lgtm
7 years, 6 months ago (2013-06-05 01:05:00 UTC) #29
piman
On 2013/06/05 01:05:00, piman wrote: > lgtm (note: I haven't done a full review of ...
7 years, 6 months ago (2013-06-05 01:05:49 UTC) #30
enne (OOO)
https://codereview.chromium.org/15579002/diff/57033/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://codereview.chromium.org/15579002/diff/57033/cc/output/direct_renderer.cc#newcode115 cc/output/direct_renderer.cc:115: scissor_rect_in_canvas_space.Offset(client_->DeviceViewport().x(), My only remaining concern here is double-checking that ...
7 years, 6 months ago (2013-06-05 16:39:06 UTC) #31
danakj
Everything looks good except the readback stuff, I think. If the origin of the viewport ...
7 years, 6 months ago (2013-06-05 17:40:44 UTC) #32
aelias_OOO_until_Jul13
OK, I made readback work and added "ExpandedViewport" versions of the RendererPixelTest suites, so now ...
7 years, 6 months ago (2013-06-06 08:57:49 UTC) #33
danakj
https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h File cc/output/direct_renderer.h (right): https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h#newcode128 cc/output/direct_renderer.h:128: // For use in coordinate conversion, this stores the ...
7 years, 6 months ago (2013-06-06 19:03:12 UTC) #34
danakj
https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h File cc/output/direct_renderer.h (right): https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h#newcode128 cc/output/direct_renderer.h:128: // For use in coordinate conversion, this stores the ...
7 years, 6 months ago (2013-06-06 19:06:00 UTC) #35
enne (OOO)
lgtm. Thanks for the pixel tests. :) https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.cc#newcode88 cc/output/direct_renderer.cc:88: DCHECK_LE(viewport_rect.bottom(), surface_size.height()); ...
7 years, 6 months ago (2013-06-06 19:07:48 UTC) #36
aelias_OOO_until_Jul13
https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h File cc/output/direct_renderer.h (right): https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h#newcode128 cc/output/direct_renderer.h:128: // For use in coordinate conversion, this stores the ...
7 years, 6 months ago (2013-06-06 19:10:58 UTC) #37
danakj
LGTM2 with some clarification of that comment
7 years, 6 months ago (2013-06-06 19:16:44 UTC) #38
danakj
On Thu, Jun 6, 2013 at 3:10 PM, <aelias@chromium.org> wrote: > > https://codereview.chromium.**org/15579002/diff/99001/cc/** > output/direct_renderer.h<https://codereview.chromium.org/15579002/diff/99001/cc/output/direct_renderer.h> ...
7 years, 6 months ago (2013-06-06 19:18:13 UTC) #39
aelias_OOO_until_Jul13
OK, all nits addressed. I'll land when the trybots go green. Thanks for all the ...
7 years, 6 months ago (2013-06-06 22:24:50 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aelias@chromium.org/15579002/115001
7 years, 6 months ago (2013-06-06 23:18:28 UTC) #41
commit-bot: I haz the power
Change committed as 204650
7 years, 6 months ago (2013-06-06 23:23:36 UTC) #42
piman
https://chromiumcodereview.appspot.com/15579002/diff/115001/cc/output/direct_renderer.cc File cc/output/direct_renderer.cc (right): https://chromiumcodereview.appspot.com/15579002/diff/115001/cc/output/direct_renderer.cc#newcode214 cc/output/direct_renderer.cc:214: client_->DeviceScaleFactor()); Note: this change triggered crbug.com/248213 because we now ...
7 years, 6 months ago (2013-06-10 22:41:42 UTC) #43
aelias_OOO_until_Jul13
7 years, 6 months ago (2013-06-10 22:49:09 UTC) #44
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/15579002/diff/115001/cc/output/direct_...
File cc/output/direct_renderer.cc (right):

https://chromiumcodereview.appspot.com/15579002/diff/115001/cc/output/direct_...
cc/output/direct_renderer.cc:214: client_->DeviceScaleFactor());
Sorry about that.  This is probably due to the ordering change relative to
EnsureBackbuffer.  We could make EnsureBackbuffer virtual and call it from
DirectRenderer.

Powered by Google App Engine
This is Rietveld 408576698