Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 { | 267 { |
| 268 double max = m_segments.isEmpty() ? 0 : m_segments.last().max(); | 268 double max = m_segments.isEmpty() ? 0 : m_segments.last().max(); |
| 269 ASSERT(upperBound > max); | 269 ASSERT(upperBound > max); |
| 270 m_segments.append(Segment(max, upperBound, timingFunction)); | 270 m_segments.append(Segment(max, upperBound, timingFunction)); |
| 271 } | 271 } |
| 272 virtual double evaluate(double fraction, double accuracy) const | 272 virtual double evaluate(double fraction, double accuracy) const |
| 273 { | 273 { |
| 274 RELEASE_ASSERT_WITH_MESSAGE(fraction >= 0 && fraction <= 1, "Web Animati ons not yet implemented: Timing function behavior outside the range [0, 1] is no t yet specified"); | 274 RELEASE_ASSERT_WITH_MESSAGE(fraction >= 0 && fraction <= 1, "Web Animati ons not yet implemented: Timing function behavior outside the range [0, 1] is no t yet specified"); |
| 275 ASSERT(!m_segments.isEmpty()); | 275 ASSERT(!m_segments.isEmpty()); |
| 276 ASSERT(m_segments.last().max() == 1); | 276 ASSERT(m_segments.last().max() == 1); |
| 277 const Segment* segment; | 277 const Segment* segment = 0; |
|
Inactive
2013/10/29 13:56:20
Maybe we could rewrite this so that it looks less
| |
| 278 for (size_t i = 0; i < m_segments.size(); ++i) { | 278 for (size_t i = 0; i < m_segments.size(); ++i) { |
| 279 segment = &m_segments[i]; | 279 segment = &m_segments[i]; |
| 280 if (fraction < segment->max()) | 280 if (fraction < segment->max()) |
| 281 break; | 281 break; |
| 282 } | 282 } |
| 283 return segment->evaluate(fraction, accuracy); | 283 return segment->evaluate(fraction, accuracy); |
| 284 } | 284 } |
| 285 | 285 |
| 286 virtual bool operator==(const TimingFunction& other) const | 286 virtual bool operator==(const TimingFunction& other) const |
| 287 { | 287 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 { | 319 { |
| 320 ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled()); | 320 ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled()); |
| 321 } | 321 } |
| 322 | 322 |
| 323 Vector<Segment> m_segments; | 323 Vector<Segment> m_segments; |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 } // namespace WebCore | 326 } // namespace WebCore |
| 327 | 327 |
| 328 #endif // TimingFunction_h | 328 #endif // TimingFunction_h |
| OLD | NEW |