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

Side by Side Diff: mojo/services/media/common/cpp/timeline_function.cc

Issue 1986303002: Motown: Use new TimelineTransform and related definitions (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixes per feedback. Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <limits> 5 #include <limits>
6 #include <utility> 6 #include <utility>
7 7
8 #include "mojo/public/cpp/environment/logging.h" 8 #include "mojo/public/cpp/environment/logging.h"
9 #include "mojo/services/media/common/cpp/timeline_function.h" 9 #include "mojo/services/media/common/cpp/timeline_function.h"
10 10
(...skipping 11 matching lines...) Expand all
22 22
23 // static 23 // static
24 TimelineFunction TimelineFunction::Compose(const TimelineFunction& bc, 24 TimelineFunction TimelineFunction::Compose(const TimelineFunction& bc,
25 const TimelineFunction& ab, 25 const TimelineFunction& ab,
26 bool exact) { 26 bool exact) {
27 return TimelineFunction(ab.reference_time(), bc.Apply(ab.subject_time()), 27 return TimelineFunction(ab.reference_time(), bc.Apply(ab.subject_time()),
28 TimelineRate::Product(ab.rate(), bc.rate(), exact)); 28 TimelineRate::Product(ab.rate(), bc.rate(), exact));
29 } 29 }
30 30
31 } // namespace media 31 } // namespace media
32
33 TimelineTransformPtr
34 TypeConverter<TimelineTransformPtr, media::TimelineFunction>::Convert(
35 const media::TimelineFunction& input) {
36 TimelineTransformPtr result = TimelineTransform::New();
37 result->reference_time = input.reference_time();
38 result->subject_time = input.subject_time();
39 result->reference_delta = input.reference_delta();
40 result->subject_delta = input.subject_delta();
41 return result;
42 }
43
44 media::TimelineFunction
45 TypeConverter<media::TimelineFunction, TimelineTransformPtr>::Convert(
46 const TimelineTransformPtr& input) {
47 return input ? media::TimelineFunction(
48 input->reference_time, input->subject_time,
49 input->reference_delta, input->subject_delta)
50 : media::TimelineFunction();
51 }
52
32 } // namespace mojo 53 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/media/common/cpp/timeline_function.h ('k') | mojo/services/media/common/cpp/timeline_rate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698