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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (index < m_frames.size() && m_frames[index].m_haveMetadata) | 360 if (index < m_frames.size() && m_frames[index].m_haveMetadata) |
361 return m_frames[index].m_duration; | 361 return m_frames[index].m_duration; |
362 return m_source.frameDurationAtIndex(index); | 362 return m_source.frameDurationAtIndex(index); |
363 } | 363 } |
364 | 364 |
365 PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame() | 365 PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame() |
366 { | 366 { |
367 return frameAtIndex(currentFrame()); | 367 return frameAtIndex(currentFrame()); |
368 } | 368 } |
369 | 369 |
| 370 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() |
| 371 { |
| 372 if (isBitmapImage() && maybeAnimated()) |
| 373 return BitmapImage::create(frameAtIndex(0)); |
| 374 |
| 375 return Image::imageForDefaultFrame(); |
| 376 } |
| 377 |
370 bool BitmapImage::frameHasAlphaAtIndex(size_t index) | 378 bool BitmapImage::frameHasAlphaAtIndex(size_t index) |
371 { | 379 { |
372 if (m_frames.size() <= index) | 380 if (m_frames.size() <= index) |
373 return true; | 381 return true; |
374 | 382 |
375 if (m_frames[index].m_haveMetadata) | 383 if (m_frames[index].m_haveMetadata) |
376 return m_frames[index].m_hasAlpha; | 384 return m_frames[index].m_hasAlpha; |
377 | 385 |
378 return m_source.frameHasAlphaAtIndex(index); | 386 return m_source.frameHasAlphaAtIndex(index); |
379 } | 387 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 } | 632 } |
625 return m_isSolidColor && !m_currentFrame; | 633 return m_isSolidColor && !m_currentFrame; |
626 } | 634 } |
627 | 635 |
628 Color BitmapImage::solidColor() const | 636 Color BitmapImage::solidColor() const |
629 { | 637 { |
630 return m_solidColor; | 638 return m_solidColor; |
631 } | 639 } |
632 | 640 |
633 } | 641 } |
OLD | NEW |