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

Unified Diff: cc/CCLayerTreeHost.cpp

Issue 10916279: Chromium compositor change implementing page-scale driven pinch-zoom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebaselined to 160422. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCLayerTreeHost.h ('k') | cc/CCLayerTreeHostCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCLayerTreeHost.cpp
===================================================================
--- cc/CCLayerTreeHost.cpp (revision 160422)
+++ 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)
« no previous file with comments | « cc/CCLayerTreeHost.h ('k') | cc/CCLayerTreeHostCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698