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

Side by Side Diff: Source/platform/animation/TimingFunction.cpp

Issue 1155773002: Devtools Animations: Add cubic bezier easing editor for animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/protocol.json ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "config.h" 5 #include "config.h"
6 #include "platform/animation/TimingFunction.h" 6 #include "platform/animation/TimingFunction.h"
7 7
8 #include "platform/animation/CubicBezierControlPoints.h" 8 #include "platform/animation/CubicBezierControlPoints.h"
9 #include "wtf/MathExtras.h" 9 #include "wtf/MathExtras.h"
10 10
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 { 350 {
351 return rhs.type() == TimingFunction::LinearFunction; 351 return rhs.type() == TimingFunction::LinearFunction;
352 } 352 }
353 353
354 bool operator==(const CubicBezierTimingFunction& lhs, const TimingFunction& rhs) 354 bool operator==(const CubicBezierTimingFunction& lhs, const TimingFunction& rhs)
355 { 355 {
356 if (rhs.type() != TimingFunction::CubicBezierFunction) 356 if (rhs.type() != TimingFunction::CubicBezierFunction)
357 return false; 357 return false;
358 358
359 const CubicBezierTimingFunction& ctf = toCubicBezierTimingFunction(rhs); 359 const CubicBezierTimingFunction& ctf = toCubicBezierTimingFunction(rhs);
360 if ((lhs.subType() == CubicBezierTimingFunction::Custom) && (ctf.subType() = = CubicBezierTimingFunction::Custom)) 360 if ((lhs.subType() == CubicBezierTimingFunction::Custom) && (ctf.subType() = = CubicBezierTimingFunction::Custom)) {
361 return (lhs.x1() == ctf.x1()) && (lhs.y1() == ctf.y1()) && (lhs.x2() == ctf.x2()) && (lhs.y2() == ctf.y2()); 361 return (lhs.x1() == ctf.x1()) && (lhs.y1() == ctf.y1()) && (lhs.x2() == ctf.x2()) && (lhs.y2() == ctf.y2());
362 }
362 363
363 return lhs.subType() == ctf.subType(); 364 return lhs.subType() == ctf.subType();
364 } 365 }
365 366
366 bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs) 367 bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs)
367 { 368 {
368 if (rhs.type() != TimingFunction::StepsFunction) 369 if (rhs.type() != TimingFunction::StepsFunction)
369 return false; 370 return false;
370 371
371 const StepsTimingFunction& stf = toStepsTimingFunction(rhs); 372 const StepsTimingFunction& stf = toStepsTimingFunction(rhs);
(...skipping 23 matching lines...) Expand all
395 return false; 396 return false;
396 } 397 }
397 398
398 // No need to define specific operator!= as they can all come via this function. 399 // No need to define specific operator!= as they can all come via this function.
399 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) 400 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs)
400 { 401 {
401 return !(lhs == rhs); 402 return !(lhs == rhs);
402 } 403 }
403 404
404 } // namespace blink 405 } // namespace blink
OLDNEW
« no previous file with comments | « Source/devtools/protocol.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698