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

Side by Side Diff: cc/layer_tree_host.cc

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_common.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 "cc/font_atlas.h" 10 #include "cc/font_atlas.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 else 727 else
728 layer->setScrollOffset(layer->scrollOffset() + info.scrolls[i].scrol lDelta); 728 layer->setScrollOffset(layer->scrollOffset() + info.scrolls[i].scrol lDelta);
729 } 729 }
730 if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1) 730 if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1)
731 m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta); 731 m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta);
732 } 732 }
733 733
734 gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& zoome dViewportPoint) 734 gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& zoome dViewportPoint)
735 const 735 const
736 { 736 {
737 if (m_implTransform.isIdentity()) 737 if (m_implTransform.IsIdentity())
738 return zoomedViewportPoint; 738 return zoomedViewportPoint;
739 739
740 DCHECK(m_implTransform.isInvertible()); 740 DCHECK(m_implTransform.IsInvertible());
741 741
742 // Scale to screen space before applying implTransform inverse. 742 // Scale to screen space before applying implTransform inverse.
743 gfx::PointF zoomedScreenspacePoint = gfx::ScalePoint(zoomedViewportPoint, de viceScaleFactor()); 743 gfx::PointF zoomedScreenspacePoint = gfx::ScalePoint(zoomedViewportPoint, de viceScaleFactor());
744 WebKit::WebTransformationMatrix inverseImplTransform = m_implTransform.inver se(); 744 gfx::Transform inverseImplTransform = MathUtil::inverse(m_implTransform);
745 745
746 bool wasClipped = false; 746 bool wasClipped = false;
747 gfx::PointF unzoomedScreenspacePoint = MathUtil::projectPoint(inverseImplTra nsform, zoomedScreenspacePoint, wasClipped); 747 gfx::PointF unzoomedScreenspacePoint = MathUtil::projectPoint(inverseImplTra nsform, zoomedScreenspacePoint, wasClipped);
748 DCHECK(!wasClipped); 748 DCHECK(!wasClipped);
749 749
750 // Convert back to logical pixels for hit testing. 750 // Convert back to logical pixels for hit testing.
751 gfx::PointF unzoomedViewportPoint = gfx::ScalePoint(unzoomedScreenspacePoint , 1 / deviceScaleFactor()); 751 gfx::PointF unzoomedViewportPoint = gfx::ScalePoint(unzoomedScreenspacePoint , 1 / deviceScaleFactor());
752 752
753 return unzoomedViewportPoint; 753 return unzoomedViewportPoint;
754 } 754 }
755 755
756 void LayerTreeHost::setImplTransform(const WebKit::WebTransformationMatrix& tran sform) 756 void LayerTreeHost::setImplTransform(const gfx::Transform& transform)
757 { 757 {
758 m_implTransform = transform; 758 m_implTransform = transform;
759 } 759 }
760 760
761 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) 761 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context)
762 { 762 {
763 if (m_animating) 763 if (m_animating)
764 return; 764 return;
765 765
766 DCHECK(context); 766 DCHECK(context);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 else 856 else
857 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); 857 layer->notifyAnimationFinished(wallClockTime.ToDoubleT());
858 } 858 }
859 } 859 }
860 860
861 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) 861 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex)
862 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); 862 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
863 } 863 }
864 864
865 } // namespace cc 865 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698