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

Issue 10916279: Chromium compositor change implementing page-scale driven pinch-zoom. (Closed)

Created:
8 years, 3 months ago by Jeff Timanus
Modified:
8 years, 2 months ago
CC:
chromium-reviews, jamesr, cc-bugs_chromium.org, wjmaclean
Visibility:
Public.

Description

Chromium compositor changes to enable a pinch-zoom path that uses page-scale instead of a CSS transformation. The plan is to maintain the existing CSS-driven pinch behaviour, and submit this change with the functionality hidden behind a flag. Corresponding WK change: https://bugs.webkit.org/show_bug.cgi?id=93292 BUG=148816 TEST=None

Patch Set 1 #

Total comments: 10

Patch Set 2 : Support the old clank pinch path by default. #

Patch Set 3 : Addressing comments from https://bugs.webkit.org/show_bug.cgi?id=93292#c27 #

Patch Set 4 : Reduce number of prepared tiles and correct existing tests. #

Total comments: 2

Patch Set 5 : Addition of some basic tests for the new pinch path. #

Patch Set 6 : Add cc_tests.gyp to the change. #

Patch Set 7 : Rebaseline to 158365. #

Total comments: 2

Patch Set 8 : PageScale now managed by CCPinchZoomViewport. #

Patch Set 9 : Remove dangling #if 0, and correct CCPinchZoomViewport::bounds(). #

Patch Set 10 : Rebaselined to 158677. #

Patch Set 11 : Remove dangling debugging printf statements. #

Patch Set 12 : Remove dependency on content_common from cc for access to kEnablePinchZoomInCompositor. #

Total comments: 25

Patch Set 13 : Parametrize tests and address comments. #

Patch Set 14 : Change m_unpinchedViewportSize and remove unnecessary >1 page scale clamping. #

Total comments: 6

Patch Set 15 : Address review comments. #

Patch Set 16 : Remove unnecessary gpu_enabled() check. #

Patch Set 17 : Rebaseline to 160197. #

Patch Set 18 : Rebaseline to 160210, and resolve merge conflicts. #

Patch Set 19 : Rebaseline to 160210, and resolve merge conflicts. #

Patch Set 20 : Rebaseline to 160227. #

Total comments: 8

Patch Set 21 : Address review comments. #

Patch Set 22 : Rebaselined to 160422. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+609 lines, -215 lines) Patch
M cc/CCLayerImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +5 lines, -4 lines 0 comments Download
M cc/CCLayerImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +8 lines, -6 lines 0 comments Download
M cc/CCLayerImplTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -2 lines 0 comments Download
M cc/CCLayerTreeHost.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M cc/CCLayerTreeHost.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +28 lines, -17 lines 0 comments Download
M cc/CCLayerTreeHostCommon.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +6 lines, -6 lines 0 comments Download
M cc/CCLayerTreeHostImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 5 chunks +58 lines, -7 lines 0 comments Download
M cc/CCLayerTreeHostImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 17 chunks +196 lines, -64 lines 0 comments Download
M cc/CCLayerTreeHostImplTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 80 chunks +213 lines, -94 lines 0 comments Download
M cc/CCLayerTreeHostTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +3 lines, -3 lines 0 comments Download
M cc/CCSettings.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M cc/CCSettings.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +5 lines, -0 lines 0 comments Download
M cc/CCThreadProxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M cc/CCThreadProxy.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M cc/LayerChromium.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +4 lines, -1 line 0 comments Download
M cc/LayerChromium.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +27 lines, -10 lines 0 comments Download
M webkit/compositor_bindings/WebCompositorImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +6 lines, -0 lines 0 comments Download
M webkit/compositor_bindings/web_compositor_support_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M webkit/compositor_bindings/web_compositor_support_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +7 lines, -0 lines 0 comments Download
M webkit/glue/webpreferences.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/glue/webpreferences.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 39 (0 generated)
enne (OOO)
https://codereview.chromium.org/10916279/diff/1/cc/CCLayerTreeHost.cpp File cc/CCLayerTreeHost.cpp (right): https://codereview.chromium.org/10916279/diff/1/cc/CCLayerTreeHost.cpp#newcode465 cc/CCLayerTreeHost.cpp:465: if (false /*layer->boundsContainPageScale()*/) I assume this can go away ...
8 years, 3 months ago (2012-09-13 19:40:54 UTC) #1
aelias_OOO_until_Jul13
https://codereview.chromium.org/10916279/diff/1/cc/LayerChromium.h File cc/LayerChromium.h (right): https://codereview.chromium.org/10916279/diff/1/cc/LayerChromium.h#newcode151 cc/LayerChromium.h:151: FloatSize localOffset() const { return FloatSize(); } On 2012/09/13 ...
8 years, 3 months ago (2012-09-13 19:47:41 UTC) #2
Jeff Timanus
Thx for having a look. At the moment, I'm trying to figure out how to ...
8 years, 3 months ago (2012-09-13 19:58:49 UTC) #3
Jeff Timanus
Please take another look. I added a command-line switch --enable-pinch-in-compositor, and plumbed it through to ...
8 years, 3 months ago (2012-09-14 04:22:26 UTC) #4
Jeff Timanus
I updated the change so that only the tiles that are necessary are prepared. Unit-tests ...
8 years, 3 months ago (2012-09-21 18:10:01 UTC) #5
aelias_OOO_until_Jul13
I'm trying this patch locally. I notice there's a bug that when you let go ...
8 years, 2 months ago (2012-09-24 23:46:45 UTC) #6
aelias_OOO_until_Jul13
http://codereview.chromium.org/10916279/diff/31001/cc/CCLayerTreeHostImpl.cpp File cc/CCLayerTreeHostImpl.cpp (right): http://codereview.chromium.org/10916279/diff/31001/cc/CCLayerTreeHostImpl.cpp#newcode55 cc/CCLayerTreeHostImpl.cpp:55: scaledBounds.scale(1 / m_pageScaleFactor); On Android, < 1 pageScaleFactors are ...
8 years, 2 months ago (2012-09-25 03:53:29 UTC) #7
Jeff Timanus
On 2012/09/24 23:46:45, aelias wrote: > I'm trying this patch locally. I notice there's a ...
8 years, 2 months ago (2012-09-25 18:01:05 UTC) #8
aelias_OOO_until_Jul13
On 2012/09/25 18:01:05, Jeff Timanus wrote: > On 2012/09/24 23:46:45, aelias wrote: > > I'm ...
8 years, 2 months ago (2012-09-25 19:51:26 UTC) #9
Jeff Timanus
On 2012/09/25 19:51:26, aelias wrote: > On 2012/09/25 18:01:05, Jeff Timanus wrote: > > On ...
8 years, 2 months ago (2012-09-25 23:50:31 UTC) #10
Jeff Timanus
On 2012/09/25 23:50:31, Jeff Timanus wrote: > On 2012/09/25 19:51:26, aelias wrote: > > On ...
8 years, 2 months ago (2012-09-25 23:51:05 UTC) #11
Jeff Timanus
PT(another)L Patch set #12 pushes the kEnablePinchInCompositor flag to CCSettings via the same model as ...
8 years, 2 months ago (2012-09-26 21:54:20 UTC) #12
aelias_OOO_until_Jul13
https://codereview.chromium.org/10916279/diff/39009/cc/CCLayerTreeHostImpl.cpp File cc/CCLayerTreeHostImpl.cpp (right): https://codereview.chromium.org/10916279/diff/39009/cc/CCLayerTreeHostImpl.cpp#newcode60 cc/CCLayerTreeHostImpl.cpp:60: float finalMagnifyScale = m_pageScaleFactor * delta; Rename "finalMagnifyScale" to ...
8 years, 2 months ago (2012-09-26 23:15:08 UTC) #13
aelias_OOO_until_Jul13
https://codereview.chromium.org/10916279/diff/39009/cc/CCLayerTreeHostImpl.cpp File cc/CCLayerTreeHostImpl.cpp (right): https://codereview.chromium.org/10916279/diff/39009/cc/CCLayerTreeHostImpl.cpp#newcode91 cc/CCLayerTreeHostImpl.cpp:91: if (totalScale > 1) On 2012/09/26 23:15:09, aelias wrote: ...
8 years, 2 months ago (2012-09-26 23:19:04 UTC) #14
Jeff Timanus
I think this version of the patch is getting close to ready to land. I ...
8 years, 2 months ago (2012-10-01 21:42:36 UTC) #15
aelias_OOO_until_Jul13
LGTM. Looking pretty clean now, let's get this landed. James, could you give it a ...
8 years, 2 months ago (2012-10-02 06:04:44 UTC) #16
jamesr
One naming nit: "implTransform" is really vague. It looks like this is either the pinchZoomTransform ...
8 years, 2 months ago (2012-10-03 19:48:56 UTC) #17
aelias_OOO_until_Jul13
For implTransform, it contains impl-thread page scale delta and scroll offset delta, but not normal ...
8 years, 2 months ago (2012-10-03 20:07:57 UTC) #18
Jeff Timanus
Thanks for the review. I addressed most of your suggestions. Given the recent discussion here, ...
8 years, 2 months ago (2012-10-03 20:56:04 UTC) #19
jamesr
I suppose implTransform is reasonable given that. Re the gpu check - you can leave ...
8 years, 2 months ago (2012-10-03 20:58:11 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/10916279/52034
8 years, 2 months ago (2012-10-04 20:19:19 UTC) #21
commit-bot: I haz the power
Failed to apply patch for cc/CCSettings.h: While running patch -p0 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 2 months ago (2012-10-04 20:19:32 UTC) #22
Jeff Timanus
Antoine, can you please OWNERS-stamp the changes in these directories: content/browser/renderer_host content/common content/browser/web_contents ui/compositor content/public
8 years, 2 months ago (2012-10-04 23:31:21 UTC) #23
piman
https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc#newcode3170 content/renderer/render_view_impl.cc:3170: webview()->setPageScaleFactorLimits(1, 4); note: this is possibly racy. isAcceleratedCompositingActive() may ...
8 years, 2 months ago (2012-10-05 00:01:08 UTC) #24
Jeff Timanus
Thx for the review. https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc#newcode3170 content/renderer/render_view_impl.cc:3170: webview()->setPageScaleFactorLimits(1, 4); On 2012/10/05 00:01:08, ...
8 years, 2 months ago (2012-10-05 00:05:34 UTC) #25
piman
https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc#newcode3170 content/renderer/render_view_impl.cc:3170: webview()->setPageScaleFactorLimits(1, 4); On 2012/10/05 00:05:34, Jeff Timanus wrote: > ...
8 years, 2 months ago (2012-10-05 00:25:51 UTC) #26
Jeff Timanus
https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc#newcode3170 content/renderer/render_view_impl.cc:3170: webview()->setPageScaleFactorLimits(1, 4); On 2012/10/05 00:25:51, piman wrote: > On ...
8 years, 2 months ago (2012-10-05 15:37:49 UTC) #27
piman
On Fri, Oct 5, 2012 at 8:37 AM, <twiz@chromium.org> wrote: > > https://chromiumcodereview.**appspot.com/10916279/diff/** > 59003/content/renderer/render_**view_impl.cc<https://chromiumcodereview.appspot.com/10916279/diff/59003/content/renderer/render_view_impl.cc> ...
8 years, 2 months ago (2012-10-05 16:04:10 UTC) #28
Jeff Timanus
On 2012/10/05 16:04:10, piman wrote: > On Fri, Oct 5, 2012 at 8:37 AM, <mailto:twiz@chromium.org> ...
8 years, 2 months ago (2012-10-05 17:54:40 UTC) #29
piman
lgtm
8 years, 2 months ago (2012-10-05 18:03:48 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/10916279/54039
8 years, 2 months ago (2012-10-05 18:05:59 UTC) #31
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
8 years, 2 months ago (2012-10-05 18:14:00 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/10916279/58007
8 years, 2 months ago (2012-10-05 18:59:17 UTC) #33
commit-bot: I haz the power
Retried try job too often for step(s) browser_tests
8 years, 2 months ago (2012-10-05 20:07:42 UTC) #34
aelias_OOO_until_Jul13
I'll try to land this.
8 years, 2 months ago (2012-10-08 17:42:07 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/10916279/58007
8 years, 2 months ago (2012-10-08 17:42:18 UTC) #36
commit-bot: I haz the power
Failed to apply patch for cc/CCLayerTreeHostCommon.cpp: While running patch -p0 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 2 months ago (2012-10-08 17:42:27 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/twiz@chromium.org/10916279/58007
8 years, 2 months ago (2012-10-08 17:46:36 UTC) #38
commit-bot: I haz the power
8 years, 2 months ago (2012-10-08 17:46:46 UTC) #39
Failed to apply patch for cc/CCLayerTreeHostCommon.cpp:
While running patch -p0 --forward --force --no-backup-if-mismatch;
  patching file cc/CCLayerTreeHostCommon.cpp
  Hunk #2 FAILED at 468.
  1 out of 2 hunks FAILED -- saving rejects to file
cc/CCLayerTreeHostCommon.cpp.rej

Patch:       cc/CCLayerTreeHostCommon.cpp
Index: cc/CCLayerTreeHostCommon.cpp
===================================================================
--- cc/CCLayerTreeHostCommon.cpp	(revision 160422)
+++ cc/CCLayerTreeHostCommon.cpp	(working copy)
@@ -271,7 +271,7 @@
     //
 
     WebTransformationMatrix partialLayerOriginTransform = parentMatrix;
-    partialLayerOriginTransform.scale(scrollingLayer->pageScaleDelta());
+    partialLayerOriginTransform.multiply(scrollingLayer->implTransform());
 
     WebTransformationMatrix scrollCompensationForThisLayer =
partialLayerOriginTransform; // Step 3
    
scrollCompensationForThisLayer.translate(scrollingLayer->scrollDelta().width(),
scrollingLayer->scrollDelta().height()); // Step 2
@@ -468,13 +468,13 @@
     float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height();
 
     WebTransformationMatrix layerLocalTransform;
-    // LT = S[pageScaleDelta]
-    layerLocalTransform.scale(layer->pageScaleDelta());
-    // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor]
+    // LT = M[impl transformation]
+    layerLocalTransform.multiply(layer->implTransform());
+    // LT = M[impl transformation] * Tr[origin] * Tr[origin2anchor]
     layerLocalTransform.translate3d(position.x() + anchorPoint.x() *
bounds.width(), position.y() + anchorPoint.y() * bounds.height(),
layer->anchorPointZ());
-    // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer]
+    // LT = M[impl transformation] * Tr[origin] * Tr[origin2anchor] * M[layer]
     layerLocalTransform.multiply(layer->transform());
-    // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] *
Tr[anchor2center]
+    // LT = M[impl transformation] * Tr[origin] * Tr[origin2anchor] * M[layer]
* Tr[anchor2center]
     layerLocalTransform.translate3d(centerOffsetX, centerOffsetY,
-layer->anchorPointZ());
 
     WebTransformationMatrix combinedTransform = parentMatrix;

Powered by Google App Engine
This is Rietveld 408576698