| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 return m_source.frameDurationAtIndex(index); | 363 return m_source.frameDurationAtIndex(index); |
| 364 } | 364 } |
| 365 | 365 |
| 366 PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame() | 366 PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame() |
| 367 { | 367 { |
| 368 return frameAtIndex(currentFrame()); | 368 return frameAtIndex(currentFrame()); |
| 369 } | 369 } |
| 370 | 370 |
| 371 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() | 371 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() |
| 372 { | 372 { |
| 373 if (frameCount() > 1) | 373 if (frameCount() > 1 && frameAtIndex(0)) |
| 374 return BitmapImage::create(frameAtIndex(0)); | 374 return BitmapImage::create(frameAtIndex(0)); |
| 375 | 375 |
| 376 return Image::imageForDefaultFrame(); | 376 return Image::imageForDefaultFrame(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool BitmapImage::frameHasAlphaAtIndex(size_t index) | 379 bool BitmapImage::frameHasAlphaAtIndex(size_t index) |
| 380 { | 380 { |
| 381 if (m_frames.size() <= index) | 381 if (m_frames.size() <= index) |
| 382 return true; | 382 return true; |
| 383 | 383 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 return m_isSolidColor && !m_currentFrame; | 634 return m_isSolidColor && !m_currentFrame; |
| 635 } | 635 } |
| 636 | 636 |
| 637 Color BitmapImage::solidColor() const | 637 Color BitmapImage::solidColor() const |
| 638 { | 638 { |
| 639 return m_solidColor; | 639 return m_solidColor; |
| 640 } | 640 } |
| 641 | 641 |
| 642 } // namespace blink | 642 } // namespace blink |
| OLD | NEW |