Changeset 106807 in webkit


Ignore:
Timestamp:
Feb 6, 2012 8:10:13 AM (12 years ago)
Author:
noam.rosenthal@nokia.com
Message:

[Texmap][Qt] Avoid an image copy when uploading textures in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=77748

Reviewed by Kenneth Rohde Christiansen.

Use QPixmap::buffer() API to get access to the QPixmap's pixels without implicit copies.

Instrumentation shows that the deep image copies created from TextureMapperGL are
eliminated.

  • platform/graphics/opengl/TextureMapperGL.cpp:

(WebCore::BitmapTextureGL::updateContents):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106806 r106807  
     12012-02-06  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        [Texmap][Qt] Avoid an image copy when uploading textures in WebKit1
     4        https://bugs.webkit.org/show_bug.cgi?id=77748
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Use QPixmap::buffer() API to get access to the QPixmap's pixels without implicit copies.
     9
     10        Instrumentation shows that the deep image copies created from TextureMapperGL are
     11        eliminated.
     12
     13        * platform/graphics/opengl/TextureMapperGL.cpp:
     14        (WebCore::BitmapTextureGL::updateContents):
     15
    1162012-02-06  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    217
  • trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp

    r106659 r106807  
    3030#include <wtf/PassRefPtr.h>
    3131#include <wtf/RefCounted.h>
     32
     33#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     34#include <QPlatformPixmap>
     35#endif
    3236
    3337#if PLATFORM(QT)
     
    634638
    635639#if PLATFORM(QT)
    636     QImage qtImage = frameImage->toImage();
     640    QImage qtImage;
     641
     642#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     643    // With QPA, we can avoid a deep copy.
     644    qtImage = *frameImage->handle()->buffer();
     645#else
     646    // This might be a deep copy, depending on other references to the pixmap.
     647    qtImage = frameImage->toImage();
     648#endif
     649
    637650    if (IntSize(qtImage.size()) != sourceRect.size())
    638651        qtImage = qtImage.copy(sourceRect);
Note: See TracChangeset for help on using the changeset viewer.