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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 PassRefPtr<BitmapImage> BitmapImage::create(PassRefPtr<NativeImageSkia> nativeIm
age, ImageObserver* observer) | 42 PassRefPtr<BitmapImage> BitmapImage::create(PassRefPtr<NativeImageSkia> nativeIm
age, ImageObserver* observer) |
43 { | 43 { |
44 if (!nativeImage) { | 44 if (!nativeImage) { |
45 return BitmapImage::create(observer); | 45 return BitmapImage::create(observer); |
46 } | 46 } |
47 | 47 |
48 return adoptRef(new BitmapImage(nativeImage, observer)); | 48 return adoptRef(new BitmapImage(nativeImage, observer)); |
49 } | 49 } |
50 | 50 |
| 51 PassRefPtr<BitmapImage> BitmapImage::createWithOrientationForTesting(PassRefPtr<
NativeImageSkia> nativeImage, ImageOrientation orientation) |
| 52 { |
| 53 RefPtr<BitmapImage> result = create(nativeImage); |
| 54 result->m_frames[0].m_orientation = orientation; |
| 55 if (orientation.usesWidthAsHeight()) |
| 56 result->m_sizeRespectingOrientation = IntSize(result->m_size.height(), r
esult->m_size.width()); |
| 57 return result.release(); |
| 58 } |
| 59 |
51 BitmapImage::BitmapImage(ImageObserver* observer) | 60 BitmapImage::BitmapImage(ImageObserver* observer) |
52 : Image(observer) | 61 : Image(observer) |
53 , m_currentFrame(0) | 62 , m_currentFrame(0) |
54 , m_frames() | 63 , m_frames() |
55 , m_frameTimer(0) | 64 , m_frameTimer(0) |
56 , m_repetitionCount(cAnimationNone) | 65 , m_repetitionCount(cAnimationNone) |
57 , m_repetitionCountStatus(Unknown) | 66 , m_repetitionCountStatus(Unknown) |
58 , m_repetitionsComplete(0) | 67 , m_repetitionsComplete(0) |
59 , m_desiredFrameStartTime(0) | 68 , m_desiredFrameStartTime(0) |
60 , m_frameCount(0) | 69 , m_frameCount(0) |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 654 |
646 return m_isSolidColor && !m_currentFrame; | 655 return m_isSolidColor && !m_currentFrame; |
647 } | 656 } |
648 | 657 |
649 Color BitmapImage::solidColor() const | 658 Color BitmapImage::solidColor() const |
650 { | 659 { |
651 return m_solidColor; | 660 return m_solidColor; |
652 } | 661 } |
653 | 662 |
654 } // namespace blink | 663 } // namespace blink |
OLD | NEW |