Index: cc/CCLayerTreeHost.cpp |
=================================================================== |
--- cc/CCLayerTreeHost.cpp (revision 159486) |
+++ cc/CCLayerTreeHost.cpp (working copy) |
@@ -542,6 +542,23 @@ |
layer->setContentsScale(deviceScaleFactor * pageScaleFactor); |
} |
+static LayerChromium* findFirstScrollableLayer(LayerChromium* layer) |
+{ |
+ if (!layer) |
+ return 0; |
+ |
+ if (layer->scrollable()) |
+ return layer; |
+ |
+ for (size_t i = 0; i < layer->children().size(); ++i) { |
+ LayerChromium* found = findFirstScrollableLayer(layer->children()[i].get()); |
+ if (found) |
+ return found; |
+ } |
+ |
+ return 0; |
+} |
+ |
static void updateLayerScale(LayerChromium* layer, float deviceScaleFactor, float pageScaleFactor) |
{ |
setScale(layer, deviceScaleFactor, pageScaleFactor); |
@@ -568,6 +585,12 @@ |
LayerList updateList; |
{ |
+ if (CCSettings::pageScalePinchZoomEnabled()) { |
+ LayerChromium* rootScroll = findFirstScrollableLayer(rootLayer); |
+ if (rootScroll) |
+ rootScroll->setImplTransform(m_implTransform); |
+ } |
+ |
TRACE_EVENT0("cc", "CCLayerTreeHost::updateLayers::calcDrawEtc"); |
CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize(), m_deviceScaleFactor, rendererCapabilities().maxTextureSize, updateList); |
CCLayerTreeHostCommon::calculateVisibleRects(updateList); |
@@ -706,23 +729,6 @@ |
return needMoreUpdates; |
} |
-static LayerChromium* findFirstScrollableLayer(LayerChromium* layer) |
-{ |
- if (!layer) |
- return 0; |
- |
- if (layer->scrollable()) |
- return layer; |
- |
- for (size_t i = 0; i < layer->children().size(); ++i) { |
- LayerChromium* found = findFirstScrollableLayer(layer->children()[i].get()); |
- if (found) |
- return found; |
- } |
- |
- return 0; |
-} |
- |
void CCLayerTreeHost::applyScrollAndScale(const CCScrollAndScaleSet& info) |
{ |
if (!m_rootLayer) |
@@ -744,6 +750,11 @@ |
m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta); |
} |
+void CCLayerTreeHost::setImplTransform(const WebKit::WebTransformationMatrix& transform) |
+{ |
+ m_implTransform = transform; |
+} |
+ |
void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) |
{ |
if (m_animating) |