Bug 51687 - [Qt] GraphicsContext::getCTM() does not need to make a copy of QPainter::combinedTransform()
: [Qt] GraphicsContext::getCTM() does not need to make a copy of QPainter::comb...
Status: RESOLVED FIXED
: WebKit
Layout and Rendering
: 528+ (Nightly build)
: PC All
: P2 Normal
Assigned To:
:
: Qt
:
:
  Show dependency treegraph
 
Reported: 2010-12-28 13:36 PST by
Modified: 2010-12-28 16:13 PST (History)


Attachments
Patch (1.49 KB, patch)
2010-12-28 13:39 PST, Jan Erik Hanssen
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-12-28 13:36:39 PST
GraphicsContext::getCTM() does not need to make a copy of the QTransform returned by QPainter::combinedTransform(), it could instead use a const reference. This will avoid a copy for compilers that don't implement (or enable by default) the NRVO optimization.
------- Comment #1 From 2010-12-28 13:39:56 PST -------
Created an attachment (id=77575) [details]
Patch
------- Comment #2 From 2010-12-28 13:43:58 PST -------
(From update of attachment 77575 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=77575&action=review

> WebCore/platform/graphics/qt/GraphicsContextQt.cpp:292
>      return AffineTransform(matrix.m11(), matrix.m12(), matrix.m21(),

Why don't we just have a AffineTransform(const QTransform&) constructor which is compiled on Qt?
------- Comment #3 From 2010-12-28 13:45:42 PST -------
I guess that's not the pattern.  No other platfrom seems to have custom constructors anymore.  Strange, since that's how we (at least used to) do IntPoint, IntRect, etc.
------- Comment #4 From 2010-12-28 14:56:12 PST -------
(From update of attachment 77575 [details])
Clearing flags on attachment: 77575

Committed r74728: <http://trac.webkit.org/changeset/74728>
------- Comment #5 From 2010-12-28 14:56:19 PST -------
All reviewed patches have been landed.  Closing bug.
------- Comment #6 From 2010-12-28 16:13:32 PST -------
http://trac.webkit.org/changeset/74728 might have broken Leopard Intel Debug (Tests)