Changeset 44669 in webkit
- Timestamp:
- Jun 13, 2009 11:44:08 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r44667 r44669 1 2009-06-13 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Kevin Ollivier. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25709 part eleven 6 Write a wx implementation so the wx port can compile. For now this is 7 mostly a copy of the Cairo port, but in the future it can be changed to 8 use a wxBitmap as the storage type everywhere (just as Cairo can 9 probably be changed). 10 11 Also ASSERT for any other ports who call getAddr() (I don't think there 12 are any, and besides, they probably won't link, but this doesn't hurt). 13 14 Also fixes a dumb Cairo build bustage typo introduced in part ten. 15 16 * platform/graphics/wx/ImageSourceWx.cpp: 17 (WebCore::ImageSource::createFrameAtIndex): 18 * platform/image-decoders/ImageDecoder.h: 19 (WebCore::RGBA32Buffer::getAddr): 20 * platform/image-decoders/cairo/ImageDecoderCairo.cpp: 21 (WebCore::RGBA32Buffer::setStatus): 22 * platform/image-decoders/wx: Added. 23 * platform/image-decoders/wx/ImageDecoderWx.cpp: Added. 24 (WebCore::RGBA32Buffer::RGBA32Buffer): 25 (WebCore::RGBA32Buffer::clear): 26 (WebCore::RGBA32Buffer::zeroFill): 27 (WebCore::RGBA32Buffer::copyBitmapData): 28 (WebCore::RGBA32Buffer::setSize): 29 (WebCore::RGBA32Buffer::asNewNativeImage): 30 (WebCore::RGBA32Buffer::hasAlpha): 31 (WebCore::RGBA32Buffer::setHasAlpha): 32 (WebCore::RGBA32Buffer::setStatus): 33 (WebCore::RGBA32Buffer::operator=): 34 (WebCore::RGBA32Buffer::width): 35 (WebCore::RGBA32Buffer::height): 36 * webcore-wx.bkl: 37 1 38 2009-06-13 Stephen White <senorblanco@chromium.org> 2 39 -
trunk/WebCore/platform/graphics/wx/ImageSourceWx.cpp
r44634 r44669 186 186 return 0; 187 187 188 IntRect imageRect = buffer->rect(); 189 unsigned char* bytes = (unsigned char*)buffer->bytes().data(); 190 long colorSize = buffer->bytes().size(); 191 192 typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> PixelData; 193 194 int width = size().width(); 195 int height = size().height(); 196 197 wxBitmap* bmp = new wxBitmap(width, height, 32); 198 PixelData data(*bmp); 199 200 int rowCounter = 0; 201 long pixelCounter = 0; 202 203 PixelData::Iterator p(data); 204 205 PixelData::Iterator rowStart = p; 206 207 // NB: It appears that the data is in BGRA format instead of RGBA format. 208 // This code works properly on both ppc and intel, meaning the issue is 209 // likely not an issue of byte order getting mixed up on different archs. 210 for (long i = 0; i < buffer->bytes().size()*4; i+=4) { 211 p.Red() = bytes[i+2]; 212 p.Green() = bytes[i+1]; 213 p.Blue() = bytes[i+0]; 214 p.Alpha() = bytes[i+3]; 215 216 p++; 217 218 pixelCounter++; 219 if ( (pixelCounter % width ) == 0 ) { 220 rowCounter++; 221 p = rowStart; 222 p.MoveTo(data, 0, rowCounter); 223 } 224 225 } 226 #if !wxCHECK_VERSION(2,9,0) 227 bmp->UseAlpha(); 228 #endif 229 ASSERT(bmp->IsOk()); 230 231 #if USE(WXGC) 232 wxGraphicsBitmap* bitmap = new wxGraphicsBitmap(wxGraphicsRenderer::GetDefaultRenderer()->CreateBitmap(*bmp)); 233 delete bmp; 234 return bitmap; 235 #else 236 return bmp; 237 #endif 188 return buffer->asNewNativeImage(); 238 189 } 239 190 -
trunk/WebCore/platform/image-decoders/ImageDecoder.h
r44661 r44669 135 135 inline PixelData* getAddr(int x, int y) 136 136 { 137 #if PLATFORM(CAIRO) 137 #if PLATFORM(CAIRO) || PLATFORM(WX) 138 138 return m_bytes.data() + (y * width()) + x; 139 139 #elif PLATFORM(SKIA) 140 140 return m_bitmap.getAddr32(x, y); 141 #else 142 ASSERT_NOT_REACHED(); 143 return 0; 141 144 #endif 142 145 } … … 158 161 } 159 162 160 #if PLATFORM(CAIRO) 163 #if PLATFORM(CAIRO) || PLATFORM(WX) 161 164 Vector<PixelData> m_bytes; 162 165 IntSize m_size; // The size of the buffer. This should be the -
trunk/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
r44661 r44669 95 95 } 96 96 97 void setStatus(FrameStatus status)97 void RGBA32Buffer::setStatus(FrameStatus status) 98 98 { 99 99 m_status = status; -
trunk/WebCore/webcore-wx.bkl
r44056 r44669 46 46 47 47 <sources> 48 48 bindings/js/ScriptControllerWx.cpp 49 49 50 50 editing/wx/EditorWx.cpp 51 51 52 page/wx/DragControllerWx.cpp 53 page/wx/EventHandlerWx.cpp 54 55 platform/graphics/wx/TransformationMatrixWx.cpp 56 platform/graphics/wx/ColorWx.cpp 57 platform/graphics/wx/FloatRectWx.cpp 58 platform/graphics/wx/GradientWx.cpp 59 platform/graphics/wx/GraphicsContextWx.cpp 60 platform/graphics/wx/ImageBufferWx.cpp 61 platform/graphics/wx/ImageSourceWx.cpp 62 platform/graphics/wx/ImageWx.cpp 63 platform/graphics/wx/IntPointWx.cpp 64 platform/graphics/wx/IntRectWx.cpp 65 platform/graphics/wx/PathWx.cpp 66 platform/graphics/wx/PenWx.cpp 67 68 platform/wx/TemporaryLinkStubs.cpp 69 platform/wx/ClipboardWx.cpp 70 platform/wx/CursorWx.cpp 71 platform/wx/DragDataWx.cpp 72 platform/wx/DragImageWx.cpp 73 platform/wx/EventLoopWx.cpp 74 platform/wx/FileSystemWx.cpp 75 platform/wx/PopupMenuWx.cpp 76 platform/graphics/wx/FontCacheWx.cpp 77 platform/graphics/wx/FontPlatformDataWx.cpp 78 platform/graphics/wx/FontWx.cpp 79 platform/graphics/wx/GlyphMapWx.cpp 80 platform/graphics/wx/SimpleFontDataWx.cpp 81 platform/wx/KeyboardEventWx.cpp 82 platform/wx/LocalizedStringsWx.cpp 83 platform/wx/LoggingWx.cpp 84 platform/wx/MimeTypeRegistryWx.cpp 85 platform/wx/MouseEventWx.cpp 86 platform/wx/MouseWheelEventWx.cpp 87 platform/wx/PasteboardWx.cpp 88 platform/wx/RenderThemeWx.cpp 89 platform/wx/ScreenWx.cpp 90 platform/wx/ScrollViewWx.cpp 91 platform/wx/SoundWx.cpp 92 platform/text/wx/StringWx.cpp 93 platform/wx/WidgetWx.cpp 94 platform/wx/ContextMenuWx.cpp 95 platform/wx/ContextMenuItemWx.cpp 96 97 <!-- files from other ports we currently rely on --> 52 page/wx/DragControllerWx.cpp 53 page/wx/EventHandlerWx.cpp 54 55 platform/graphics/wx/TransformationMatrixWx.cpp 56 platform/graphics/wx/ColorWx.cpp 57 platform/graphics/wx/FloatRectWx.cpp 58 platform/graphics/wx/GradientWx.cpp 59 platform/graphics/wx/GraphicsContextWx.cpp 60 platform/graphics/wx/ImageBufferWx.cpp 61 platform/graphics/wx/ImageSourceWx.cpp 62 platform/graphics/wx/ImageWx.cpp 63 platform/graphics/wx/IntPointWx.cpp 64 platform/graphics/wx/IntRectWx.cpp 65 platform/graphics/wx/PathWx.cpp 66 platform/graphics/wx/PenWx.cpp 67 68 platform/image-decoders/wx/ImageDecoderWx.cpp 69 70 platform/wx/TemporaryLinkStubs.cpp 71 platform/wx/ClipboardWx.cpp 72 platform/wx/CursorWx.cpp 73 platform/wx/DragDataWx.cpp 74 platform/wx/DragImageWx.cpp 75 platform/wx/EventLoopWx.cpp 76 platform/wx/FileSystemWx.cpp 77 platform/wx/PopupMenuWx.cpp 78 platform/graphics/wx/FontCacheWx.cpp 79 platform/graphics/wx/FontPlatformDataWx.cpp 80 platform/graphics/wx/FontWx.cpp 81 platform/graphics/wx/GlyphMapWx.cpp 82 platform/graphics/wx/SimpleFontDataWx.cpp 83 platform/wx/KeyboardEventWx.cpp 84 platform/wx/LocalizedStringsWx.cpp 85 platform/wx/LoggingWx.cpp 86 platform/wx/MimeTypeRegistryWx.cpp 87 platform/wx/MouseEventWx.cpp 88 platform/wx/MouseWheelEventWx.cpp 89 platform/wx/PasteboardWx.cpp 90 platform/wx/RenderThemeWx.cpp 91 platform/wx/ScreenWx.cpp 92 platform/wx/ScrollViewWx.cpp 93 platform/wx/SoundWx.cpp 94 platform/text/wx/StringWx.cpp 95 platform/wx/WidgetWx.cpp 96 platform/wx/ContextMenuWx.cpp 97 platform/wx/ContextMenuItemWx.cpp 98 99 <!-- files from other ports we currently rely on --> 98 100 platform/network/curl/CookieJarCurl.cpp 99 101 platform/network/curl/FormDataStreamCurl.cpp
Note: See TracChangeset
for help on using the changeset viewer.