[webkit-reviews] review granted: [Bug 105519] Reducing print preview scale significantly causes a crash : [Attachment 180308] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 20 09:34:23 PST 2012


Alexey Proskuryakov <ap at webkit.org> has granted Tim Horton
<timothy_horton at apple.com>'s request for review:
Bug 105519: Reducing print preview scale significantly causes a crash
https://bugs.webkit.org/show_bug.cgi?id=105519

Attachment 180308: patch
https://bugs.webkit.org/attachment.cgi?id=180308&action=review

------- Additional Comments from Alexey Proskuryakov <ap at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=180308&action=review


> Source/WebKit2/ChangeLog:12
> +	   The bitmap image used for print previews was being created
respecting the print preview scale.
> +	   This doesn't make any sense, as the scale does not affect the size
of the image required to
> +	   represent the previewed page. Instead, we should not scale the size,
creating the buffer at a
> +	   size that is constant regardless of scale, and do the scaling when
drawing *into* the buffer instead.

With four lines of explanation, I'm still not quite sure if this was an out of
memory crash :)

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:3283
> +	   float printingScale = (float)desiredImageSize.width() /
rect.width();

We generally prefer static_cast.

> Source/WebKit2/WebProcess/WebPage/WebPage.messages.in:220
> +    DrawRectToImage(uint64_t frameID, WebKit::PrintInfo printInfo,
WebCore::IntRect rect, WebCore::IntSize desiredImageSize, uint64_t callbackID)

"Desired" makes it sound like the desire may not be granted. Is that accurate?


More information about the webkit-reviews mailing list