Bug 113764

Summary: Render images with low-quality scaling while FrameView is being resized.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: Andreas Kling <kling>
Severity: Normal CC: anilsson, barraclough, darin, eric, esprehn+autocc, kling, koivisto, ojan.autocc, sam, tonikitoo, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar, Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch idea
Proposed patch koivisto: review+

Description Andreas Kling 2013-04-02 03:10:19 PDT
Live resizing a window typically causes a ton of image repaints. For images not at 1:1 scale, we should rescale at low quality until resizing ends. This'll avoid unnecessary work, especially on high-DPI devices where upscaled images are common.
Comment 1 Radar WebKit Bug Importer 2013-04-02 03:10:58 PDT
Comment 2 Andreas Kling 2013-04-02 03:44:05 PDT
Created attachment 196115 [details]
Patch idea

Initial stab. Seems to work pretty well on my rMBP, thoughts welcome.
Comment 3 Andreas Kling 2013-04-02 06:08:12 PDT
Comment on attachment 196115 [details]
Patch idea

I ran into an issue where GIF animations can cause the ImageQualityController to punt the HQ repaint indefinitely. Retracting patch for now.
Comment 4 Andreas Kling 2013-04-04 05:16:26 PDT
Created attachment 196468 [details]
Proposed patch

Use a separate flag in ImageQualityController to determine whether we're in the "live window resize optimization" mode.
Comment 5 WebKit Review Bot 2013-04-04 05:26:16 PDT
Attachment 196468 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/rendering/RenderBoxModelObject.cpp']" exit_code: 1
Source/WebCore/rendering/RenderBoxModelObject.cpp:187:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 1 in 2 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Antti Koivisto 2013-04-04 07:26:44 PDT
Comment on attachment 196468 [details]
Proposed patch

Comment 7 Antti Koivisto 2013-04-04 07:27:27 PDT
Comment on attachment 196468 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=196468&action=review

> Source/WebCore/rendering/RenderBoxModelObject.cpp:192
> +            return true;
> +        } else if (m_liveResizeOptimizationIsActive) {

No need for else after return.
Comment 8 Andreas Kling 2013-04-04 09:27:19 PDT
Committed r147638: <http://trac.webkit.org/changeset/147638>