Bug 51687 - [Qt] GraphicsContext::getCTM() does not need to make a copy of QPainter::combinedTransform()
Summary: [Qt] GraphicsContext::getCTM() does not need to make a copy of QPainter::comb...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Keywords: Qt
Depends on:
Reported: 2010-12-28 13:36 PST by Jan Erik Hanssen
Modified: 2010-12-28 16:13 PST (History)
6 users (show)

See Also:

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

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Erik Hanssen 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 Jan Erik Hanssen 2010-12-28 13:39:56 PST
Created attachment 77575 [details]
Comment 2 Eric Seidel 2010-12-28 13:43:58 PST
Comment on 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 Eric Seidel 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 WebKit Commit Bot 2010-12-28 14:56:12 PST
Comment on attachment 77575 [details]

Clearing flags on attachment: 77575

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