| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 PassRefPtr<BitmapImage> BitmapImage::createWithOrientationForTesting(const SkBit
map& bitmap, ImageOrientation orientation) | 44 PassRefPtr<BitmapImage> BitmapImage::createWithOrientationForTesting(const SkBit
map& bitmap, ImageOrientation orientation) |
| 45 { | 45 { |
| 46 if (bitmap.isNull()) { | 46 if (bitmap.isNull()) { |
| 47 return BitmapImage::create(); | 47 return BitmapImage::create(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 RefPtr<BitmapImage> result = adoptRef(new BitmapImage(bitmap)); | 50 RefPtr<BitmapImage> result = adoptRef(new BitmapImage(bitmap)); |
| 51 result->m_frames[0].m_orientation = orientation; | 51 result->m_frames[0].m_orientation = orientation; |
| 52 if (orientation.usesWidthAsHeight()) | 52 if (orientation.usesWidthAsHeight()) |
| 53 result->m_sizeRespectingOrientation = IntSize(result->m_size.height(), r
esult->m_size.width()); | 53 result->m_sizeRespectingOrientation = result->m_size.transposedSize(); |
| 54 return result.release(); | 54 return result.release(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 BitmapImage::BitmapImage(ImageObserver* observer) | 57 BitmapImage::BitmapImage(ImageObserver* observer) |
| 58 : Image(observer) | 58 : Image(observer) |
| 59 , m_currentFrame(0) | 59 , m_currentFrame(0) |
| 60 , m_repetitionCount(cAnimationNone) | 60 , m_repetitionCount(cAnimationNone) |
| 61 , m_repetitionCountStatus(Unknown) | 61 , m_repetitionCountStatus(Unknown) |
| 62 , m_repetitionsComplete(0) | 62 , m_repetitionsComplete(0) |
| 63 , m_desiredFrameStartTime(0) | 63 , m_desiredFrameStartTime(0) |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 destroyDecodedDataIfNecessary(); | 674 destroyDecodedDataIfNecessary(); |
| 675 | 675 |
| 676 // We need to draw this frame if we advanced to it while not skipping, or if | 676 // We need to draw this frame if we advanced to it while not skipping, or if |
| 677 // while trying to skip frames we hit the last frame and thus had to stop. | 677 // while trying to skip frames we hit the last frame and thus had to stop. |
| 678 if (skippingFrames != advancedAnimation) | 678 if (skippingFrames != advancedAnimation) |
| 679 imageObserver()->animationAdvanced(this); | 679 imageObserver()->animationAdvanced(this); |
| 680 return advancedAnimation; | 680 return advancedAnimation; |
| 681 } | 681 } |
| 682 | 682 |
| 683 } // namespace blink | 683 } // namespace blink |
| OLD | NEW |