Changeset 44669 in webkit


Ignore:
Timestamp:
Jun 13, 2009 11:44:08 PM (15 years ago)
Author:
pkasting@chromium.org
Message:

2009-06-13 Peter Kasting <pkasting@google.com>

Reviewed by Kevin Ollivier.

https://bugs.webkit.org/show_bug.cgi?id=25709 part eleven
Write a wx implementation so the wx port can compile. For now this is
mostly a copy of the Cairo port, but in the future it can be changed to
use a wxBitmap as the storage type everywhere (just as Cairo can
probably be changed).


Also ASSERT for any other ports who call getAddr() (I don't think there
are any, and besides, they probably won't link, but this doesn't hurt).


Also fixes a dumb Cairo build bustage typo introduced in part ten.

  • platform/graphics/wx/ImageSourceWx.cpp: (WebCore::ImageSource::createFrameAtIndex):
  • platform/image-decoders/ImageDecoder.h: (WebCore::RGBA32Buffer::getAddr):
  • platform/image-decoders/cairo/ImageDecoderCairo.cpp: (WebCore::RGBA32Buffer::setStatus):
  • platform/image-decoders/wx: Added.
  • platform/image-decoders/wx/ImageDecoderWx.cpp: Added. (WebCore::RGBA32Buffer::RGBA32Buffer): (WebCore::RGBA32Buffer::clear): (WebCore::RGBA32Buffer::zeroFill): (WebCore::RGBA32Buffer::copyBitmapData): (WebCore::RGBA32Buffer::setSize): (WebCore::RGBA32Buffer::asNewNativeImage): (WebCore::RGBA32Buffer::hasAlpha): (WebCore::RGBA32Buffer::setHasAlpha): (WebCore::RGBA32Buffer::setStatus): (WebCore::RGBA32Buffer::operator=): (WebCore::RGBA32Buffer::width): (WebCore::RGBA32Buffer::height):
  • webcore-wx.bkl:
Location:
trunk/WebCore
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44667 r44669  
     12009-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
    1382009-06-13  Stephen White  <senorblanco@chromium.org>
    239
  • trunk/WebCore/platform/graphics/wx/ImageSourceWx.cpp

    r44634 r44669  
    186186        return 0;
    187187   
    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();
    238189}
    239190
  • trunk/WebCore/platform/image-decoders/ImageDecoder.h

    r44661 r44669  
    135135        inline PixelData* getAddr(int x, int y)
    136136        {
    137 #if PLATFORM(CAIRO)
     137#if PLATFORM(CAIRO) || PLATFORM(WX)
    138138            return m_bytes.data() + (y * width()) + x;
    139139#elif PLATFORM(SKIA)
    140140            return m_bitmap.getAddr32(x, y);
     141#else
     142            ASSERT_NOT_REACHED();
     143            return 0;
    141144#endif
    142145        }
     
    158161        }
    159162
    160 #if PLATFORM(CAIRO)
     163#if PLATFORM(CAIRO) || PLATFORM(WX)
    161164        Vector<PixelData> m_bytes;
    162165        IntSize m_size;       // The size of the buffer.  This should be the
  • trunk/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp

    r44661 r44669  
    9595}
    9696
    97 void setStatus(FrameStatus status)
     97void RGBA32Buffer::setStatus(FrameStatus status)
    9898{
    9999    m_status = status;
  • trunk/WebCore/webcore-wx.bkl

    r44056 r44669  
    4646       
    4747        <sources>
    48             bindings/js/ScriptControllerWx.cpp
     48          bindings/js/ScriptControllerWx.cpp
    4949
    50             editing/wx/EditorWx.cpp
     50          editing/wx/EditorWx.cpp
    5151
    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 -->
    98100            platform/network/curl/CookieJarCurl.cpp
    99101            platform/network/curl/FormDataStreamCurl.cpp
Note: See TracChangeset for help on using the changeset viewer.