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

Side by Side Diff: Source/WebCore/platform/animation/AnimationUtilities.h

Issue 9328025: Merge 106672 - REGRESSION (r105401-105403): Blue flash on css border transition (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 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 | « LayoutTests/animations/animation-border-overflow-expected.txt ('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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 19 matching lines...) Expand all
30 30
31 namespace WebCore { 31 namespace WebCore {
32 32
33 inline int blend(int from, int to, double progress) 33 inline int blend(int from, int to, double progress)
34 { 34 {
35 return static_cast<int>(lround(static_cast<double>(from) + static_cast<doubl e>(to - from) * progress)); 35 return static_cast<int>(lround(static_cast<double>(from) + static_cast<doubl e>(to - from) * progress));
36 } 36 }
37 37
38 inline unsigned blend(unsigned from, unsigned to, double progress) 38 inline unsigned blend(unsigned from, unsigned to, double progress)
39 { 39 {
40 return static_cast<unsigned>(lround(static_cast<double>(from) + static_cast< double>(to - from) * progress)); 40 return static_cast<unsigned>(lround(to > from ? static_cast<double>(from) + static_cast<double>(to - from) * progress : static_cast<double>(from) - static_c ast<double>(from - to) * progress));
41 } 41 }
42 42
43 inline double blend(double from, double to, double progress) 43 inline double blend(double from, double to, double progress)
44 { 44 {
45 return from + (to - from) * progress; 45 return from + (to - from) * progress;
46 } 46 }
47 47
48 inline float blend(float from, float to, double progress) 48 inline float blend(float from, float to, double progress)
49 { 49 {
50 return static_cast<float>(from + (to - from) * progress); 50 return static_cast<float>(from + (to - from) * progress);
51 } 51 }
52 52
53 } // namespace WebCore 53 } // namespace WebCore
54 54
55 #endif // AnimationUtilities_h 55 #endif // AnimationUtilities_h
OLDNEW
« no previous file with comments | « LayoutTests/animations/animation-border-overflow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698