Changeset 50123 in webkit


Ignore:
Timestamp:
Oct 26, 2009 7:50:04 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-26 Girish Ramakrishnan <Girish Ramakrishnan>

Reviewed by Antti Koivisto.

[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled

When printing, QPrinter's preview mode uses a QPicture to capture the output. The
QPicture holds a reference to the X Pixmap. As a result, the print preview would
update itself when the X Pixmap changes. To prevent the print preview from updating
whenever m_drawable is updated (i.e when the view updates), we create a copy.

We require that a QPixmap::copy() result in a QPixmap backed by a XPixmap
regardless of the graphicssystem. This is taken care of by
commit d310f7c710ecb331a9689861f0551eabd38e946e in Qt (4.6)

The beauty of this patch is that the newly created X Pixmap is managed by Qt and
it will free the Pixmap whenever the user closes the print preview dialog and
handles the case of displaying multiple preview dialogs nicely.

All credit to Samuel Rødal for suggesting usage of QPixmap::copy().

https://bugs.webkit.org/show_bug.cgi?id=30714

  • plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::paint):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50122 r50123  
     12009-10-26  Girish Ramakrishnan  <girish@forwardbias.in>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        [Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled
     6       
     7        When printing, QPrinter's preview mode uses a QPicture to capture the output. The
     8        QPicture holds a reference to the X Pixmap. As a result, the print preview would
     9        update itself when the X Pixmap changes. To prevent the print preview from updating
     10        whenever m_drawable is updated (i.e when the view updates), we create a copy.
     11       
     12        We require that a QPixmap::copy() result in a QPixmap backed by a XPixmap
     13        regardless of the graphicssystem. This is taken care of by
     14        commit d310f7c710ecb331a9689861f0551eabd38e946e in Qt (4.6)
     15       
     16        The beauty of this patch is that the newly created X Pixmap is managed by Qt and
     17        it will free the Pixmap whenever the user closes the print preview dialog and
     18        handles the case of displaying multiple preview dialogs nicely.
     19       
     20        All credit to Samuel Rødal for suggesting usage of QPixmap::copy().
     21       
     22        https://bugs.webkit.org/show_bug.cgi?id=30714
     23
     24        * plugins/qt/PluginViewQt.cpp:
     25        (WebCore::PluginView::paint):
     26
    1272009-10-26  Benjamin Otte  <otte@gnome.org>
    228
  • trunk/WebCore/plugins/qt/PluginViewQt.cpp

    r49975 r50123  
    187187    ASSERT(drawableDepth == qtDrawable.depth());
    188188
     189    // When printing, Qt uses a QPicture the capture the output in preview mode. The
     190    // QPicture holds a reference to the X Pixmap. As a result, the print preview would
     191    // update itself when the X Pixmap changes. To prevent this, we create a copy.
     192    if (m_element->document()->printing())
     193        qtDrawable = qtDrawable.copy();
     194
    189195    if (m_isTransparent && drawableDepth != 32) {
    190196        // Attempt content propagation for drawable with no alpha by copying over from the backing store
     
    222228    exposeEvent.type = GraphicsExpose;
    223229    exposeEvent.display = QX11Info::display();
    224     exposeEvent.drawable = m_drawable;
     230    exposeEvent.drawable = qtDrawable.handle();
    225231    exposeEvent.x = exposedRect.x();
    226232    exposeEvent.y = exposedRect.y();
Note: See TracChangeset for help on using the changeset viewer.