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

Side by Side Diff: cc/blink/web_scroll_offset_animation_curve_impl.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/blink/web_scroll_offset_animation_curve_impl.h ('k') | cc/blink/web_scrollbar_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/blink/web_scroll_offset_animation_curve_impl.h"
6
7 #include "cc/animation/scroll_offset_animation_curve.h"
8 #include "cc/animation/timing_function.h"
9 #include "cc/blink/web_animation_curve_common.h"
10
11 using blink::WebFloatPoint;
12
13 namespace cc_blink {
14
15 WebScrollOffsetAnimationCurveImpl::WebScrollOffsetAnimationCurveImpl(
16 WebFloatPoint target_value,
17 TimingFunctionType timing_function)
18 : curve_(cc::ScrollOffsetAnimationCurve::Create(
19 gfx::ScrollOffset(target_value.x, target_value.y),
20 CreateTimingFunction(timing_function))) {
21 }
22
23 WebScrollOffsetAnimationCurveImpl::~WebScrollOffsetAnimationCurveImpl() {
24 }
25
26 blink::WebCompositorAnimationCurve::AnimationCurveType
27 WebScrollOffsetAnimationCurveImpl::type() const {
28 return WebCompositorAnimationCurve::AnimationCurveTypeScrollOffset;
29 }
30
31 void WebScrollOffsetAnimationCurveImpl::setInitialValue(
32 WebFloatPoint initial_value) {
33 curve_->SetInitialValue(gfx::ScrollOffset(initial_value.x, initial_value.y));
34 }
35
36 WebFloatPoint WebScrollOffsetAnimationCurveImpl::getValue(double time) const {
37 gfx::ScrollOffset value =
38 curve_->GetValue(base::TimeDelta::FromSecondsD(time));
39 return WebFloatPoint(value.x(), value.y());
40 }
41
42 double WebScrollOffsetAnimationCurveImpl::duration() const {
43 return curve_->Duration().InSecondsF();
44 }
45
46 WebFloatPoint WebScrollOffsetAnimationCurveImpl::targetValue() const {
47 gfx::ScrollOffset target = curve_->target_value();
48 return WebFloatPoint(target.x(), target.y());
49 }
50
51 void WebScrollOffsetAnimationCurveImpl::updateTarget(double time,
52 WebFloatPoint new_target) {
53 curve_->UpdateTarget(time, gfx::ScrollOffset(new_target.x, new_target.y));
54 }
55
56 scoped_ptr<cc::AnimationCurve>
57 WebScrollOffsetAnimationCurveImpl::CloneToAnimationCurve() const {
58 return curve_->Clone();
59 }
60
61 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_scroll_offset_animation_curve_impl.h ('k') | cc/blink/web_scrollbar_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698