Changeset 35993 in webkit


Ignore:
Timestamp:
Aug 29, 2008 8:57:44 AM (16 years ago)
Author:
Simon Hausmann
Message:

2008-08-29 Holger Hans Peter Freyther <zecke@selfish.org>

Reviewed by Eric Seidel.

[janitor/qt] Start replacing port specific getters with the generic native getter
To get the native presentation of an image we currently have platform
specific #ifdef's and a generic getter using NativeImagePtr. This patch
extends this to the ImageBuffer and updates the Qt platform to get rid
of the special #ifdefs.

https://bugs.webkit.org/attachment.cgi?id=22861

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r35992 r35993  
     12008-08-29  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [janitor/qt] Start replacing port specific getters with the generic native getter
     6        To get the native presentation of an image we currently have platform
     7        specific #ifdef's and a generic getter using NativeImagePtr. This patch
     8        extends this to the ImageBuffer and updates the Qt platform to get rid
     9        of the special #ifdefs.
     10
     11        https://bugs.webkit.org/attachment.cgi?id=22861
     12
     13        * platform/graphics/BitmapImage.h:
     14        * platform/graphics/Image.h:
     15        * platform/graphics/qt/ImageQt.cpp:
     16        * platform/graphics/qt/StillImageQt.cpp:
     17        * platform/graphics/qt/StillImageQt.h:
     18        * platform/qt/ClipboardQt.cpp:
     19        (WebCore::ClipboardQt::createDragImage):
     20        (WebCore::ClipboardQt::declareAndWriteDragImage):
     21        * platform/qt/CursorQt.cpp:
     22        * platform/qt/PasteboardQt.cpp:
     23        (WebCore::Pasteboard::writeImage):
     24
    1252008-08-29  Holger Hans Peter Freyther  <zecke@selfish.org>
    226
  • trunk/WebCore/platform/graphics/BitmapImage.h

    r35934 r35993  
    129129#endif
    130130
    131 #if PLATFORM(QT)
    132     virtual QPixmap* getPixmap() const;
    133 #endif
    134    
    135131#if PLATFORM(WIN)
    136132    virtual bool getHBITMAP(HBITMAP);
  • trunk/WebCore/platform/graphics/Image.h

    r35934 r35993  
    135135#endif
    136136
    137 #if PLATFORM(QT)
    138     virtual QPixmap* getPixmap() const { return 0; }
    139 #endif
    140 
    141137#if PLATFORM(WIN)
    142138    virtual bool getHBITMAP(HBITMAP) { return false; }
  • trunk/WebCore/platform/graphics/qt/ImageQt.cpp

    r35737 r35993  
    165165}
    166166
    167 QPixmap* BitmapImage::getPixmap() const
    168 {
    169     return const_cast<BitmapImage*>(this)->frameAtIndex(0);
    170 }
    171 
    172167}
    173168
  • trunk/WebCore/platform/graphics/qt/StillImageQt.cpp

    r32981 r35993  
    4545}
    4646
    47 QPixmap* StillImage::getPixmap() const
     47NativeImagePtr StillImage::nativeImageForCurrentFrame()
    4848{
    49     return const_cast<QPixmap*>(&m_pixmap);
     49    return const_cast<NativeImagePtr>(&m_pixmap);
    5050}
    5151
  • trunk/WebCore/platform/graphics/qt/StillImageQt.h

    r35737 r35993  
    4646
    4747        virtual IntSize size() const;
    48         virtual QPixmap* getPixmap() const;
     48        virtual NativeImagePtr nativeImageForCurrentFrame();
    4949        virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
    5050
  • trunk/WebCore/platform/qt/ClipboardQt.cpp

    r32625 r35993  
    209209        return 0;
    210210    dragLoc = m_dragLoc;
    211     return m_dragImage->image()->getPixmap();
     211    return m_dragImage->image()->nativeImageForCurrentFrame();
    212212}
    213213
     
    241241    if (!cachedImage || !cachedImage->image() || !cachedImage->isLoaded())
    242242        return;
    243     QPixmap *pixmap = cachedImage->image()->getPixmap();
     243    QPixmap *pixmap = cachedImage->image()->nativeImageForCurrentFrame();
    244244    if (pixmap)
    245245        m_writableData->setImageData(pixmap);
  • trunk/WebCore/platform/qt/CursorQt.cpp

    r35532 r35993  
    6060Cursor::Cursor(Image* image, const IntPoint& hotspot)
    6161#ifndef QT_NO_CURSOR
    62     : m_impl(*(image->getPixmap()), hotspot.x(), hotspot.y())
     62    : m_impl(*(image->nativeImageForCurrentFrame()), hotspot.x(), hotspot.y())
    6363#endif
    6464{
  • trunk/WebCore/platform/qt/PasteboardQt.cpp

    r32625 r35993  
    145145    ASSERT(image);
    146146
    147     QPixmap* pixmap = image->getPixmap();
     147    QPixmap* pixmap = image->nativeImageForCurrentFrame();
    148148    ASSERT(pixmap);
    149149
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r35853 r35993  
    983983    WebCore::Image *img = hitTest.image();
    984984    if (img) {
    985         QPixmap *pix = img->getPixmap();
     985        QPixmap *pix = img->nativeImageForCurrentFrame();
    986986        if (pix)
    987987            pixmap = *pix;
  • trunk/WebKit/qt/Api/qwebhistory.cpp

    r35991 r35993  
    131131QIcon QWebHistoryItem::icon() const
    132132{
    133     return *d->item->icon()->getPixmap();
     133    return *d->item->icon()->nativeImageForCurrentFrame();
    134134}
    135135
  • trunk/WebKit/qt/Api/qwebsettings.cpp

    r35716 r35993  
    439439        return QPixmap();
    440440    }
    441     QPixmap *icon = image->getPixmap();
     441    QPixmap *icon = image->nativeImageForCurrentFrame();
    442442    if (!icon) {
    443443        return QPixmap();
  • trunk/WebKit/qt/ChangeLog

    r35991 r35993  
     12008-08-29  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [janitor/qt] Start replacing port specific getters with the generic native getter
     6        To get the native presentation of an image we currently have platform
     7        specific #ifdef's and a generic getter using NativeImagePtr. This patch
     8        extends this to the ImageBuffer and updates the Qt platform to get rid
     9        of the special #ifdefs.
     10
     11        https://bugs.webkit.org/attachment.cgi?id=22861
     12
     13        * Api/qwebframe.cpp:
     14        (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
     15        * Api/qwebhistory.cpp:
     16        * Api/qwebsettings.cpp:
     17        (QWebSettings::iconForUrl):
     18
    1192008-08-29  Holger Hans Peter Freyther  <zecke@selfish.org>
    220
Note: See TracChangeset for help on using the changeset viewer.