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

Side by Side Diff: cc/layer_tree_host.cc

Issue 12082012: Implement desktop compatibility viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aelias
Patch Set: Created 7 years, 10 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 unified diff | Download patch
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // considered active. 304 // considered active.
305 syncTree->DidBecomeActive(); 305 syncTree->DidBecomeActive();
306 } 306 }
307 307
308 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); 308 hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize());
309 hostImpl->setDeviceScaleFactor(deviceScaleFactor()); 309 hostImpl->setDeviceScaleFactor(deviceScaleFactor());
310 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto r, m_maxPageScaleFactor); 310 hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFacto r, m_maxPageScaleFactor);
311 hostImpl->setDebugState(m_debugState); 311 hostImpl->setDebugState(m_debugState);
312 hostImpl->savePaintTime(m_renderingStats.totalPaintTime); 312 hostImpl->savePaintTime(m_renderingStats.totalPaintTime);
313 313
314 if (LayerImpl* rootScrollLayer = syncTree->RootScrollLayer()) {
315 fprintf (stderr, "debug: %d %d\n", rootScrollLayer->sentDesktopCompatibi lityViewportOffsetFromScrollPositionDelta().x(), rootScrollLayer->sentDesktopCom patibilityViewportOffsetFromScrollPositionDelta().y());
316 // FIXME FIXME FIXME
317 rootScrollLayer->setDesktopCompatibilityViewportOffsetFromScrollPosition (rootScrollLayer->desktopCompatibilityViewportOffsetFromScrollPosition() + rootS crollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDelta());
318 rootScrollLayer->setDesktopCompatibilityViewportOffsetFromScrollPosition Delta(rootScrollLayer->desktopCompatibilityViewportOffsetFromScrollPositionDelta () - rootScrollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDe lta());
319 rootScrollLayer->setSentDesktopCompatibilityViewportOffsetFromScrollPosi tionDelta(gfx::Vector2d());
320 }
321
314 if (newImplTreeHasNoEvictedResources) { 322 if (newImplTreeHasNoEvictedResources) {
315 if (syncTree->ContentsTexturesPurged()) 323 if (syncTree->ContentsTexturesPurged())
316 syncTree->ResetContentsTexturesPurged(); 324 syncTree->ResetContentsTexturesPurged();
317 } 325 }
318 326
319 m_commitNumber++; 327 m_commitNumber++;
320 } 328 }
321 329
322 void LayerTreeHost::willCommit() 330 void LayerTreeHost::willCommit()
323 { 331 {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 749
742 for (size_t i = 0; i < info.scrolls.size(); ++i) { 750 for (size_t i = 0; i < info.scrolls.size(); ++i) {
743 Layer* layer = LayerTreeHostCommon::findLayerInSubtree(m_rootLayer.get() , info.scrolls[i].layerId); 751 Layer* layer = LayerTreeHostCommon::findLayerInSubtree(m_rootLayer.get() , info.scrolls[i].layerId);
744 if (!layer) 752 if (!layer)
745 continue; 753 continue;
746 if (layer == rootScrollLayer) 754 if (layer == rootScrollLayer)
747 rootScrollDelta += info.scrolls[i].scrollDelta; 755 rootScrollDelta += info.scrolls[i].scrollDelta;
748 else 756 else
749 layer->setScrollOffset(layer->scrollOffset() + info.scrolls[i].scrol lDelta); 757 layer->setScrollOffset(layer->scrollOffset() + info.scrolls[i].scrol lDelta);
750 } 758 }
751 if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1) 759 if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1 || !info.desktopCo mpatibilityViewportOffsetFromScrollPositionDelta.IsZero())
752 m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta); 760 m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta, info .desktopCompatibilityViewportOffsetFromScrollPositionDelta);
753 } 761 }
754 762
755 void LayerTreeHost::setImplTransform(const gfx::Transform& transform) 763 void LayerTreeHost::setImplTransform(const gfx::Transform& transform)
756 { 764 {
757 m_implTransform = transform; 765 m_implTransform = transform;
758 } 766 }
759 767
760 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) 768 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context)
761 { 769 {
762 if (m_animating) 770 if (m_animating)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) 858 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex)
851 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); 859 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
852 } 860 }
853 861
854 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() 862 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture()
855 { 863 {
856 return m_proxy->capturePicture(); 864 return m_proxy->capturePicture();
857 } 865 }
858 866
859 } // namespace cc 867 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698