Changeset 88797 in webkit


Ignore:
Timestamp:
Jun 14, 2011 6:54:29 AM (13 years ago)
Author:
noam.rosenthal@nokia.com
Message:

2011-06-14 Noam Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Implement accelerated compositing on WK2 Qt port
https://bugs.webkit.org/show_bug.cgi?id=56935

Add a createImage() function to ShareableBitmap, for now ifdef'ed to Qt only.
This allows us to support directly composited images across the WebKit2 processes.

Together with Viatcheslav Ostapenko.

  • Shared/ShareableBitmap.h:
  • Shared/qt/ShareableBitmapQt.cpp: (WebKit::ShareableBitmap::createQImage): (WebKit::ShareableBitmap::createImage):
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r88735 r88797  
     12011-06-14  Noam Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Implement accelerated compositing on WK2 Qt port
     6        https://bugs.webkit.org/show_bug.cgi?id=56935
     7
     8        Add a createImage() function to ShareableBitmap, for now ifdef'ed to Qt only.
     9        This allows us to support directly composited images across the WebKit2 processes.
     10
     11        Together with Viatcheslav Ostapenko.
     12
     13        * Shared/ShareableBitmap.h:
     14        * Shared/qt/ShareableBitmapQt.cpp:
     15        (WebKit::ShareableBitmap::createQImage):
     16        (WebKit::ShareableBitmap::createImage):
     17
    1182011-06-13  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebKit2/Shared/ShareableBitmap.h

    r87160 r88797  
    2828
    2929#include "SharedMemory.h"
     30#include <WebCore/Image.h>
    3031#include <WebCore/IntRect.h>
    3132#include <wtf/PassOwnPtr.h>
     
    122123    // This is only safe to use when we know that the contents of the shareable bitmap won't change.
    123124    QImage createQImage();
     125    PassRefPtr<WebCore::Image> createImage();
    124126#endif
    125127
  • trunk/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp

    r87160 r88797  
    2929#include <QImage>
    3030#include <QPainter>
     31#include <WebCore/BitmapImage.h>
    3132#include <WebCore/GraphicsContext.h>
    3233
     
    3738QImage ShareableBitmap::createQImage()
    3839{
    39     return QImage(reinterpret_cast<uchar*>(data()), m_size.width(), m_size.height(), m_size.width() * 4, QImage::Format_RGB32);
     40    return QImage(reinterpret_cast<uchar*>(data()), m_size.width(), m_size.height(), m_size.width() * 4,
     41                  m_flags & SupportsAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
    4042}
     43
     44#if PLATFORM(QT)
     45PassRefPtr<Image> ShareableBitmap::createImage()
     46{
     47    QPixmap* pixmap = new QPixmap(QPixmap::fromImage(createQImage()));
     48    return BitmapImage::create(pixmap);
     49}
     50#endif
    4151
    4252PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
Note: See TracChangeset for help on using the changeset viewer.