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

Side by Side Diff: cc/animation/timing_function.cc

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/animation/scroll_offset_animation_curve.cc ('k') | cc/base/math_util.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "cc/animation/timing_function.h" 7 #include "cc/animation/timing_function.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 void CubicBezierTimingFunction::Range(float* min, float* max) const { 36 void CubicBezierTimingFunction::Range(float* min, float* max) const {
37 double min_d = 0; 37 double min_d = 0;
38 double max_d = 1; 38 double max_d = 1;
39 bezier_.Range(&min_d, &max_d); 39 bezier_.Range(&min_d, &max_d);
40 *min = static_cast<float>(min_d); 40 *min = static_cast<float>(min_d);
41 *max = static_cast<float>(max_d); 41 *max = static_cast<float>(max_d);
42 } 42 }
43 43
44 scoped_ptr<TimingFunction> CubicBezierTimingFunction::Clone() const { 44 scoped_ptr<TimingFunction> CubicBezierTimingFunction::Clone() const {
45 return make_scoped_ptr(new CubicBezierTimingFunction(*this)); 45 return make_scoped_ptr(new CubicBezierTimingFunction(*this))
46 .PassAs<TimingFunction>();
46 } 47 }
47 48
48 // These numbers come from 49 // These numbers come from
49 // http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag. 50 // http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag.
50 scoped_ptr<TimingFunction> EaseTimingFunction::Create() { 51 scoped_ptr<TimingFunction> EaseTimingFunction::Create() {
51 return CubicBezierTimingFunction::Create(0.25, 0.1, 0.25, 1.0); 52 return CubicBezierTimingFunction::Create(
53 0.25, 0.1, 0.25, 1.0).PassAs<TimingFunction>();
52 } 54 }
53 55
54 scoped_ptr<TimingFunction> EaseInTimingFunction::Create() { 56 scoped_ptr<TimingFunction> EaseInTimingFunction::Create() {
55 return CubicBezierTimingFunction::Create(0.42, 0.0, 1.0, 1.0); 57 return CubicBezierTimingFunction::Create(
58 0.42, 0.0, 1.0, 1.0).PassAs<TimingFunction>();
56 } 59 }
57 60
58 scoped_ptr<TimingFunction> EaseOutTimingFunction::Create() { 61 scoped_ptr<TimingFunction> EaseOutTimingFunction::Create() {
59 return CubicBezierTimingFunction::Create(0.0, 0.0, 0.58, 1.0); 62 return CubicBezierTimingFunction::Create(
63 0.0, 0.0, 0.58, 1.0).PassAs<TimingFunction>();
60 } 64 }
61 65
62 scoped_ptr<TimingFunction> EaseInOutTimingFunction::Create() { 66 scoped_ptr<TimingFunction> EaseInOutTimingFunction::Create() {
63 return CubicBezierTimingFunction::Create(0.42, 0.0, 0.58, 1); 67 return CubicBezierTimingFunction::Create(
68 0.42, 0.0, 0.58, 1).PassAs<TimingFunction>();
64 } 69 }
65 70
66 } // namespace cc 71 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/scroll_offset_animation_curve.cc ('k') | cc/base/math_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698