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 "cc/font_atlas.h" | 10 #include "cc/font_atlas.h" |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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& point
) | 734 gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& point
) |
735 const | 735 const |
736 { | 736 { |
737 WebKit::WebTransformationMatrix inverseImplTransform = m_implTransform; | 737 gfx::Transform inverseImplTransform = m_implTransform; |
738 // TODO(wjmaclean) Need to determine why the next two lines are | 738 // TODO(wjmaclean) Need to determine why the next two lines are |
739 // necessary for this to work ... it seems like just inverting | 739 // necessary for this to work ... it seems like just inverting |
740 // m_implTransform should be sufficient. | 740 // m_implTransform should be sufficient. |
741 DCHECK(inverseImplTransform.m11()); | 741 DCHECK(inverseImplTransform.matrix().getDouble(0, 0)); |
742 DCHECK(inverseImplTransform.m22()); | 742 DCHECK(inverseImplTransform.matrix().getDouble(1, 1)); |
743 inverseImplTransform.setM41(inverseImplTransform.m41() | 743 inverseImplTransform.matrix().setDouble(0, 3, inverseImplTransform.matrix().
getDouble(0, 3) |
744 / inverseImplTransform.m11()); | 744 / inverseImplTransform.matrix().getDouble(0, 0)); |
745 inverseImplTransform.setM42(inverseImplTransform.m42() | 745 inverseImplTransform.matrix().setDouble(1, 3, inverseImplTransform.matrix().
getDouble(1, 3) |
746 / inverseImplTransform.m22()); | 746 / inverseImplTransform.matrix().getDouble(1, 1)); |
747 inverseImplTransform = inverseImplTransform.inverse(); | 747 inverseImplTransform = MathUtil::inverse(inverseImplTransform); |
748 bool wasClipped = false; | 748 bool wasClipped = false; |
749 gfx::PointF adjustedPoint = MathUtil::projectPoint(inverseImplTransform, poi
nt, wasClipped); | 749 gfx::PointF adjustedPoint = MathUtil::projectPoint(inverseImplTransform, poi
nt, wasClipped); |
750 DCHECK(!wasClipped); | 750 DCHECK(!wasClipped); |
751 | 751 |
752 return adjustedPoint; | 752 return adjustedPoint; |
753 } | 753 } |
754 | 754 |
755 void LayerTreeHost::setImplTransform(const WebKit::WebTransformationMatrix& tran
sform) | 755 void LayerTreeHost::setImplTransform(const gfx::Transform& transform) |
756 { | 756 { |
757 m_implTransform = transform; | 757 m_implTransform = transform; |
758 } | 758 } |
759 | 759 |
760 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) | 760 void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) |
761 { | 761 { |
762 if (m_animating) | 762 if (m_animating) |
763 return; | 763 return; |
764 | 764 |
765 DCHECK(context); | 765 DCHECK(context); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 else | 855 else |
856 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 856 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
857 } | 857 } |
858 } | 858 } |
859 | 859 |
860 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 860 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
861 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 861 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
862 } | 862 } |
863 | 863 |
864 } // namespace cc | 864 } // namespace cc |
OLD | NEW |