OLD | NEW |
---|---|
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/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& zoome dViewportPoint) | 750 gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& zoome dViewportPoint) |
751 const | 751 const |
752 { | 752 { |
753 if (m_implTransform.IsIdentity()) | 753 if (m_implTransform.IsIdentity()) |
754 return zoomedViewportPoint; | 754 return zoomedViewportPoint; |
755 | 755 |
756 DCHECK(m_implTransform.IsInvertible()); | 756 DCHECK(m_implTransform.IsInvertible()); |
757 | 757 |
758 // Scale to screen space before applying implTransform inverse. | 758 // Scale to screen space before applying implTransform inverse. |
759 gfx::PointF zoomedScreenspacePoint = gfx::ScalePoint(zoomedViewportPoint, de viceScaleFactor()); | 759 gfx::PointF zoomedScreenspacePoint = gfx::ScalePoint(zoomedViewportPoint, de viceScaleFactor()); |
760 gfx::Transform inverseImplTransform = MathUtil::inverse(m_implTransform); | 760 gfx::Transform inverseImplTransform(gfx::Transform::kSkipInitialization); |
761 m_implTransform.GetInverse(&inverseImplTransform); | |
danakj
2012/12/19 05:23:06
You could DCHECK the result of GetInverse() here t
| |
761 | 762 |
762 bool wasClipped = false; | 763 bool wasClipped = false; |
763 gfx::PointF unzoomedScreenspacePoint = MathUtil::projectPoint(inverseImplTra nsform, zoomedScreenspacePoint, wasClipped); | 764 gfx::PointF unzoomedScreenspacePoint = MathUtil::projectPoint(inverseImplTra nsform, zoomedScreenspacePoint, wasClipped); |
764 DCHECK(!wasClipped); | 765 DCHECK(!wasClipped); |
765 | 766 |
766 // Convert back to logical pixels for hit testing. | 767 // Convert back to logical pixels for hit testing. |
767 gfx::PointF unzoomedViewportPoint = gfx::ScalePoint(unzoomedScreenspacePoint , 1 / deviceScaleFactor()); | 768 gfx::PointF unzoomedViewportPoint = gfx::ScalePoint(unzoomedScreenspacePoint , 1 / deviceScaleFactor()); |
768 | 769 |
769 return unzoomedViewportPoint; | 770 return unzoomedViewportPoint; |
770 } | 771 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
872 else | 873 else |
873 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 874 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
874 } | 875 } |
875 } | 876 } |
876 | 877 |
877 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) | 878 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) |
878 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); | 879 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
879 } | 880 } |
880 | 881 |
881 } // namespace cc | 882 } // namespace cc |
OLD | NEW |