Bug 30714 - [Qt] Windowed Plugins : Print preview shows only part of flash when view is scrolled
Summary: [Qt] Windowed Plugins : Print preview shows only part of flash when view is s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2009-10-23 08:20 PDT by Girish Ramakrishnan
Modified: 2009-10-26 19:50 PDT (History)
2 users (show)

See Also:


Attachments
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled (2.59 KB, patch)
2009-10-23 08:23 PDT, Girish Ramakrishnan
no flags Details | Formatted Diff | Diff
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled (1.50 KB, patch)
2009-10-23 19:54 PDT, Girish Ramakrishnan
no flags Details | Formatted Diff | Diff
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled (2.98 KB, patch)
2009-10-23 19:55 PDT, Girish Ramakrishnan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Girish Ramakrishnan 2009-10-23 08:20:09 PDT
Print preview shows only part of flash when view is scrolled
Comment 1 Girish Ramakrishnan 2009-10-23 08:23:04 PDT
Created attachment 41726 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled
Comment 2 Girish Ramakrishnan 2009-10-23 19:54:48 PDT
Created attachment 41774 [details]
[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
---
 WebCore/plugins/qt/PluginViewQt.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Comment 3 Girish Ramakrishnan 2009-10-23 19:55:46 PDT
Created attachment 41775 [details]
[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
---
 WebCore/ChangeLog                   |   26 ++++++++++++++++++++++++++
 WebCore/plugins/qt/PluginViewQt.cpp |    8 +++++++-
 2 files changed, 33 insertions(+), 1 deletions(-)
Comment 4 Girish Ramakrishnan 2009-10-23 19:57:23 PDT
Comment on attachment 41775 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled

Sorry, I keep forgetting the ChangeLog.
Comment 5 Holger Freyther 2009-10-23 20:50:44 PDT
Comment on attachment 41775 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled


> +    // When printing, Qt uses a QPicture the capture the output in preview mode. The

Replace the 2nd the to "to"? looks great besides that.
Comment 6 Girish Ramakrishnan 2009-10-23 20:55:58 PDT
(In reply to comment #5)
> (From update of attachment 41775 [details])
> 
> > +    // When printing, Qt uses a QPicture the capture the output in preview mode. The
> 
> Replace the 2nd the to "to"? looks great besides that.

The third patch I uploaded sometime back fixes that.
Comment 7 Antti Koivisto 2009-10-26 15:50:18 PDT
r=me
Comment 8 WebKit Commit Bot 2009-10-26 16:04:32 PDT
Comment on attachment 41775 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled

Rejecting patch 41775 from commit-queue.

Failed to run "['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--quiet', '--exit-after-n-failures=1']" exit_code: 1
Running build-dumprendertree
Running tests from /Users/eseidel/Projects/CommitQueue/LayoutTests
Testing 11520 test cases.
svg/css/getComputedStyle-basic.xhtml -> failed

Exiting early after 1 failures. 9845 tests run.
322.18s total testing time

9844 test cases (99%) succeeded
1 test case (<1%) had incorrect layout
6 test cases (<1%) had stderr output
Comment 9 Eric Seidel (no email) 2009-10-26 16:24:23 PDT
Comment on attachment 41775 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled

The bots are just way behind.  bug 30098
Comment 10 WebKit Commit Bot 2009-10-26 19:50:15 PDT
Comment on attachment 41775 [details]
[Qt] Windowless Plugins : Print preview shows only part of flash when view is scrolled

Clearing flags on attachment: 41775

Committed r50123: <http://trac.webkit.org/changeset/50123>
Comment 11 WebKit Commit Bot 2009-10-26 19:50:21 PDT
All reviewed patches have been landed.  Closing bug.