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

Side by Side Diff: Source/core/platform/animation/TimingFunction.h

Issue 51943004: Creating a helper class for reversing timing functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing "control reaches end of non-void function" issues. Created 7 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
« no previous file with comments | « Source/core/core.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 private: 276 private:
277 double scaleToLocal(double x) const { return (x - m_min) / (m_max - m_mi n); } 277 double scaleToLocal(double x) const { return (x - m_min) / (m_max - m_mi n); }
278 double scaleFromLocal(double x) const { return blend(m_min, m_max, x); } 278 double scaleFromLocal(double x) const { return blend(m_min, m_max, x); }
279 279
280 double m_min; 280 double m_min;
281 double m_max; 281 double m_max;
282 RefPtr<TimingFunction> m_timingFunction; 282 RefPtr<TimingFunction> m_timingFunction;
283 283
284 // Allow the compositor to reverse the timing function.
285 friend class CompositorAnimationsTimingFunctionReverser;
286
284 // Allow PrintTo/operator== of the segments. Can be removed once 287 // Allow PrintTo/operator== of the segments. Can be removed once
285 // ChainedTimingFunction has a public API for segments. 288 // ChainedTimingFunction has a public API for segments.
286 friend class ChainedTimingFunctionTestHelper; 289 friend class ChainedTimingFunctionTestHelper;
287 }; 290 };
288 291
289 ChainedTimingFunction() 292 ChainedTimingFunction()
290 : TimingFunction(ChainedFunction) 293 : TimingFunction(ChainedFunction)
291 { 294 {
292 ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled()); 295 ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled());
293 } 296 }
294 297
295 Vector<Segment> m_segments; 298 Vector<Segment> m_segments;
296 299
300 // Allow the compositor to reverse the timing function.
301 friend class CompositorAnimationsTimingFunctionReverser;
302
297 // Allow PrintTo/operator== of the segments. Can be removed once 303 // Allow PrintTo/operator== of the segments. Can be removed once
298 // ChainedTimingFunction has a public API for segments. 304 // ChainedTimingFunction has a public API for segments.
299 friend class ChainedTimingFunctionTestHelper; 305 friend class ChainedTimingFunctionTestHelper;
300 }; 306 };
301 307
302 } // namespace WebCore 308 } // namespace WebCore
303 309
304 #endif // TimingFunction_h 310 #endif // TimingFunction_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698