OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> | 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> |
4 * Copyright (C) 2008, Google Inc. All rights reserved. | 4 * Copyright (C) 2008, Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return frameSizeAtIndex(0, shouldRespectOrientation); | 78 return frameSizeAtIndex(0, shouldRespectOrientation); |
79 } | 79 } |
80 | 80 |
81 IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum
shouldRespectOrientation) const | 81 IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum
shouldRespectOrientation) const |
82 { | 82 { |
83 if (!m_decoder) | 83 if (!m_decoder) |
84 return IntSize(); | 84 return IntSize(); |
85 | 85 |
86 IntSize size = m_decoder->frameSizeAtIndex(index); | 86 IntSize size = m_decoder->frameSizeAtIndex(index); |
87 if ((shouldRespectOrientation == RespectImageOrientation) && m_decoder->orie
ntationAtIndex(index).usesWidthAsHeight()) | 87 if ((shouldRespectOrientation == RespectImageOrientation) && m_decoder->orie
ntationAtIndex(index).usesWidthAsHeight()) |
88 return IntSize(size.height(), size.width()); | 88 return size.transposedSize(); |
89 | 89 |
90 return size; | 90 return size; |
91 } | 91 } |
92 | 92 |
93 bool ImageSource::getHotSpot(IntPoint& hotSpot) const | 93 bool ImageSource::getHotSpot(IntPoint& hotSpot) const |
94 { | 94 { |
95 return m_decoder ? m_decoder->hotSpot(hotSpot) : false; | 95 return m_decoder ? m_decoder->hotSpot(hotSpot) : false; |
96 } | 96 } |
97 | 97 |
98 int ImageSource::repetitionCount() | 98 int ImageSource::repetitionCount() |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 { | 147 { |
148 return m_decoder && m_decoder->frameIsCachedAndLazyDecodedAtIndex(index); | 148 return m_decoder && m_decoder->frameIsCachedAndLazyDecodedAtIndex(index); |
149 } | 149 } |
150 | 150 |
151 size_t ImageSource::frameBytesAtIndex(size_t index) const | 151 size_t ImageSource::frameBytesAtIndex(size_t index) const |
152 { | 152 { |
153 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; | 153 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |