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

Unified Diff: Source/platform/scroll/ProgrammaticScrollAnimator.h

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ProgrammaticScrollAnimator.h
diff --git a/Source/core/xml/parser/SharedBufferReader.h b/Source/platform/scroll/ProgrammaticScrollAnimator.h
similarity index 61%
copy from Source/core/xml/parser/SharedBufferReader.h
copy to Source/platform/scroll/ProgrammaticScrollAnimator.h
index 7217de95fcf74bdadcf451da55088bc4eeda8fb7..f90f0ce7d8723246202b62d2304692926cb6d018 100644
--- a/Source/core/xml/parser/SharedBufferReader.h
+++ b/Source/platform/scroll/ProgrammaticScrollAnimator.h
@@ -28,33 +28,52 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SharedBufferReader_h
-#define SharedBufferReader_h
+#ifndef ProgrammaticScrollAnimator_h
+#define ProgrammaticScrollAnimator_h
+#include "platform/geometry/FloatPoint.h"
#include "wtf/FastAllocBase.h"
-#include "wtf/Forward.h"
-#include "wtf/RefPtr.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+class WebScrollOffsetAnimationCurve;
+}
namespace WebCore {
-class SharedBuffer;
+class ScrollableArea;
-// Allows transfer of data in multiple chunks from a SharedBuffer to a provided buffer.
-class SharedBufferReader {
+class ProgrammaticScrollAnimator {
+ WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator);
WTF_MAKE_FAST_ALLOCATED;
public:
- SharedBufferReader(PassRefPtr<SharedBuffer>);
+ static PassOwnPtr<ProgrammaticScrollAnimator> create(ScrollableArea*);
+
+ ~ProgrammaticScrollAnimator();
+
+ void animateToOffset(FloatPoint);
+ void cancelAnimation();
+ void tickAnimation(double monotonicTime);
- ~SharedBufferReader();
+ void notifyAnimationStarted(double monotonicTime);
+ void notifyAnimationFinished(double monotonicTime);
- // Returns the number of bytes that were read (i.e. written to |outputBuffer|).
- int readData(char* outputBuffer, unsigned askedToRead);
+ void canUseCompositedScrollAnimationsDidChange();
private:
- RefPtr<SharedBuffer> m_buffer;
- unsigned m_currentOffset;
+ explicit ProgrammaticScrollAnimator(ScrollableArea*);
+
+ void resetAnimationState();
+
+ ScrollableArea* m_scrollableArea;
+ OwnPtr<blink::WebScrollOffsetAnimationCurve> m_animationCurve;
+ FloatPoint m_targetOffset;
+ int m_animationId;
+ double m_startTime;
};
} // namespace WebCore
-#endif // SharedBufferReader_h
+#endif // ProgrammaticScrollAnimator_h
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698