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

Side by Side Diff: cc/page_scale_animation.h

Issue 11364189: cc: Clean up PageScaleAnimation for readability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing gfx:: Created 8 years, 1 month 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_impl.cc ('k') | cc/page_scale_animation.cc » ('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 #ifndef CC_PAGE_SCALE_ANIMATION_H_ 5 #ifndef CC_PAGE_SCALE_ANIMATION_H_
6 #define CC_PAGE_SCALE_ANIMATION_H_ 6 #define CC_PAGE_SCALE_ANIMATION_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 #include "ui/gfx/vector2d_f.h" 10 #include "ui/gfx/vector2d_f.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 const gfx::Vector2dF& targetScrollOffset() const { return m_targetScrollOffs et; } 51 const gfx::Vector2dF& targetScrollOffset() const { return m_targetScrollOffs et; }
52 float targetPageScaleFactor() const { return m_targetPageScaleFactor; } 52 float targetPageScaleFactor() const { return m_targetPageScaleFactor; }
53 53
54 protected: 54 protected:
55 PageScaleAnimation(const gfx::Vector2dF& startScrollOffset, float startPageS caleFactor, const gfx::SizeF& viewportSize, const gfx::SizeF& rootLayerSize, dou ble startTime); 55 PageScaleAnimation(const gfx::Vector2dF& startScrollOffset, float startPageS caleFactor, const gfx::SizeF& viewportSize, const gfx::SizeF& rootLayerSize, dou ble startTime);
56 56
57 private: 57 private:
58 void clampTargetScrollOffset(); 58 void clampTargetScrollOffset();
59 void inferTargetScrollOffsetFromStartAnchor(); 59 void inferTargetScrollOffsetFromStartAnchor();
60 void inferTargetAnchorFromScrollOffsets(); 60 void inferTargetAnchorFromScrollOffsets();
61 gfx::SizeF viewportSizeAtScale(float pageScaleFactor) const;
62 61
62 gfx::SizeF startViewportSize() const;
63 gfx::SizeF targetViewportSize() const;
63 float interpAtTime(double time) const; 64 float interpAtTime(double time) const;
65 gfx::SizeF viewportSizeAt(float interp) const;
64 gfx::Vector2dF scrollOffsetAt(float interp) const; 66 gfx::Vector2dF scrollOffsetAt(float interp) const;
65 gfx::Vector2dF anchorAt(float interp) const; 67 gfx::Vector2dF anchorAt(float interp) const;
66 gfx::Vector2dF viewportRelativeAnchorAt(float interp) const; 68 gfx::Vector2dF viewportRelativeAnchorAt(float interp) const;
67 float pageScaleFactorAt(float interp) const; 69 float pageScaleFactorAt(float interp) const;
68 70
69 float m_startPageScaleFactor; 71 float m_startPageScaleFactor;
70 float m_targetPageScaleFactor; 72 float m_targetPageScaleFactor;
71 gfx::Vector2dF m_startScrollOffset; 73 gfx::Vector2dF m_startScrollOffset;
72 gfx::Vector2dF m_targetScrollOffset; 74 gfx::Vector2dF m_targetScrollOffset;
73 75
74 gfx::Vector2dF m_startAnchor; 76 gfx::Vector2dF m_startAnchor;
75 gfx::Vector2dF m_targetAnchor; 77 gfx::Vector2dF m_targetAnchor;
76 78
77 gfx::SizeF m_viewportSize; 79 gfx::SizeF m_viewportSize;
78 gfx::SizeF m_rootLayerSize; 80 gfx::SizeF m_rootLayerSize;
79 81
80 double m_startTime; 82 double m_startTime;
81 double m_duration; 83 double m_duration;
82 }; 84 };
83 85
84 } // namespace cc 86 } // namespace cc
85 87
86 #endif // CC_PAGE_SCALE_ANIMATION_H_ 88 #endif // CC_PAGE_SCALE_ANIMATION_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/page_scale_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698