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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 PassRefPtr<SkImage> BitmapImage::imageForCurrentFrame() | 385 PassRefPtr<SkImage> BitmapImage::imageForCurrentFrame() |
386 { | 386 { |
387 return frameAtIndex(currentFrame()); | 387 return frameAtIndex(currentFrame()); |
388 } | 388 } |
389 | 389 |
390 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() | 390 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() |
391 { | 391 { |
392 if (frameCount() > 1) { | 392 if (frameCount() > 1) { |
393 RefPtr<SkImage> firstFrame = frameAtIndex(0); | 393 RefPtr<SkImage> firstFrame = frameAtIndex(0); |
394 if (firstFrame) | 394 if (firstFrame) |
395 return StaticBitmapImage::create(firstFrame); | 395 return StaticBitmapImage::create(firstFrame, true); |
Justin Novosad
2016/01/07 17:12:01
Really? A bitmap Image can be cross-origin.
xidachen
2016/01/08 18:07:55
Acknowledged.
| |
396 } | 396 } |
397 | 397 |
398 return Image::imageForDefaultFrame(); | 398 return Image::imageForDefaultFrame(); |
399 } | 399 } |
400 | 400 |
401 bool BitmapImage::frameHasAlphaAtIndex(size_t index) | 401 bool BitmapImage::frameHasAlphaAtIndex(size_t index) |
402 { | 402 { |
403 if (m_frames.size() <= index) | 403 if (m_frames.size() <= index) |
404 return true; | 404 return true; |
405 | 405 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
642 destroyDecodedDataIfNecessary(); | 642 destroyDecodedDataIfNecessary(); |
643 | 643 |
644 // We need to draw this frame if we advanced to it while not skipping, or if | 644 // We need to draw this frame if we advanced to it while not skipping, or if |
645 // while trying to skip frames we hit the last frame and thus had to stop. | 645 // while trying to skip frames we hit the last frame and thus had to stop. |
646 if (skippingFrames != advancedAnimation) | 646 if (skippingFrames != advancedAnimation) |
647 imageObserver()->animationAdvanced(this); | 647 imageObserver()->animationAdvanced(this); |
648 return advancedAnimation; | 648 return advancedAnimation; |
649 } | 649 } |
650 | 650 |
651 } // namespace blink | 651 } // namespace blink |
OLD | NEW |