Changeset 44661 in webkit
- Timestamp:
- Jun 13, 2009 6:00:20 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r44659 r44661 1 2009-06-13 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Eric Seidel. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25709 part ten 6 Make Skia use the root directory ImageDecoder.h and factor out most 7 Skia-specific bits into skia/ImageDecoderSkia.cpp. Also fix a pair of 8 style violations in ImageDecoderCairo.cpp. This is the last patch for 9 this bug, everything beyond this is an enhancement rather than 10 unforking. 11 12 * platform/image-decoders/ImageDecoder.h: 13 (WebCore::RGBA32Buffer::getAddr): 14 * platform/image-decoders/cairo/ImageDecoderCairo.cpp: 15 (WebCore::RGBA32Buffer::hasAlpha): 16 (WebCore::RGBA32Buffer::setHasAlpha): 17 (WebCore::setStatus): 18 * platform/image-decoders/skia/ImageDecoder.h: Removed. 19 * platform/image-decoders/skia/ImageDecoderSkia.cpp: Added. 20 (WebCore::RGBA32Buffer::RGBA32Buffer): 21 (WebCore::RGBA32Buffer::clear): 22 (WebCore::RGBA32Buffer::zeroFill): 23 (WebCore::RGBA32Buffer::copyBitmapData): 24 (WebCore::RGBA32Buffer::setSize): 25 (WebCore::RGBA32Buffer::asNewNativeImage): 26 (WebCore::RGBA32Buffer::hasAlpha): 27 (WebCore::RGBA32Buffer::setHasAlpha): 28 (WebCore::RGBA32Buffer::setStatus): 29 (WebCore::RGBA32Buffer::operator=): 30 (WebCore::RGBA32Buffer::width): 31 (WebCore::RGBA32Buffer::height): 32 1 33 2009-06-13 Victor Wang <victorw@chromium.org> 2 34 -
trunk/WebCore/platform/image-decoders/ImageDecoder.h
r44654 r44661 35 35 #include <wtf/Vector.h> 36 36 37 #if PLATFORM(SKIA) 38 #include "NativeImageSkia.h" 39 #include "SkBitmap.h" 40 #endif 41 37 42 namespace WebCore { 38 43 … … 50 55 DisposeOverwritePrevious, // Clear frame to previous framebuffer contents 51 56 }; 57 #if PLATFORM(SKIA) 58 typedef uint32_t PixelData; 59 #else 52 60 typedef unsigned PixelData; 61 #endif 53 62 54 63 RGBA32Buffer(); … … 94 103 // allocation fails. Calling this multiple times is undefined and may 95 104 // leak memory. 96 bool setSize(int width, int height);105 bool setSize(int newWidth, int newHeight); 97 106 98 107 // To be used by ImageSource::createFrameAtIndex(). Returns a pointer … … 109 118 void setHasAlpha(bool alpha); 110 119 void setRect(const IntRect& r) { m_rect = r; } 111 void setStatus(FrameStatus s ) { m_status = s; }120 void setStatus(FrameStatus status); 112 121 void setDuration(unsigned duration) { m_duration = duration; } 113 122 void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; } … … 128 137 #if PLATFORM(CAIRO) 129 138 return m_bytes.data() + (y * width()) + x; 139 #elif PLATFORM(SKIA) 140 return m_bitmap.getAddr32(x, y); 130 141 #endif 131 142 } … … 152 163 // same as ImageDecoder::m_size. 153 164 bool m_hasAlpha; // Whether or not any of the pixels in the buffer have transparency. 165 #elif PLATFORM(SKIA) 166 NativeImageSkia m_bitmap; 154 167 #endif 155 168 IntRect m_rect; // The rect of the original specified frame within the overall buffer. -
trunk/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
r44653 r44661 64 64 } 65 65 66 bool RGBA32Buffer::setSize(int width, int height)66 bool RGBA32Buffer::setSize(int newWidth, int newHeight) 67 67 { 68 68 // NOTE: This has no way to check for allocation failure if the 69 69 // requested size was too big... 70 m_bytes.resize( width * height);71 m_size = IntSize( width, height);70 m_bytes.resize(newWidth * newHeight); 71 m_size = IntSize(newWidth, newHeight); 72 72 73 73 // Zero the image. … … 85 85 } 86 86 87 bool RGBA32Buffer::hasAlpha() const { 87 bool RGBA32Buffer::hasAlpha() const 88 { 88 89 return m_hasAlpha; 89 90 } 90 91 91 void RGBA32Buffer::setHasAlpha(bool alpha) { 92 void RGBA32Buffer::setHasAlpha(bool alpha) 93 { 92 94 m_hasAlpha = alpha; 95 } 96 97 void setStatus(FrameStatus status) 98 { 99 m_status = status; 93 100 } 94 101
Note: See TracChangeset
for help on using the changeset viewer.