Bug 29438 - [Qt] NPAPI: HBITMAP to QPixmap conversion is slow
Summary: [Qt] NPAPI: HBITMAP to QPixmap conversion is slow
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Windows XP
: P2 Normal
Assignee: Nobody
Keywords: Performance, Qt, QtTriaged
Depends on:
Blocks: 35962
  Show dependency treegraph
Reported: 2009-09-18 07:48 PDT by Tor Arne Vestbø
Modified: 2014-01-28 20:30 PST (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tor Arne Vestbø 2009-09-18 07:48:34 PDT
banner uses more CPU time than normal browser.

This bug report originated from issue QTBUG-4251

--- Description ---

Simple test application (source attached) shows webpage with flash 
banner. Unfortunately it uses much more CPU time than normal browser 
which shows same page (Internet Explorer, Mozilla Firefox, Safari).

We analysed application using DevPartner profiler and it shows that 
problem is with QT and WebKit integration.

Application spend lot of time in function QPixmap::fromWinHBITMAP() in 
We analysed releaseWindowsContext() function and think that translation 
from HDC to QPixmap is not optimal solution. Source code below:

  HBITMAP bitmap = static_cast<HBITMAP>(GetCurrentObject(hdc, OBJ_BITMAP));
  BITMAP info;
  GetObject(bitmap, sizeof(info), &info);
  ASSERT(info.bmBitsPixel == 32);

  QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap, supportAlphaBlend ? 
QPixmap::PremultipliedAlpha : QPixmap::NoAlpha);
  m_data->p()->drawPixmap(dstRect, pixmap);

We think that it will be better to draw HDC directly on the screen 
without translation to QPixmap.
Comment 1 Kenneth Rohde Christiansen 2009-10-18 08:33:46 PDT
This seems Windows related, I'm changing platform to Windows from Mac OS X
Comment 2 David T. L. Wong 2010-01-20 02:40:51 PST
Is it similar problem of https://bugs.webkit.org/show_bug.cgi?id=24913#c1