Bug 72919 - [chromium] updateRect is probably incorrect when contentBounds != bounds
Summary: [chromium] updateRect is probably incorrect when contentBounds != bounds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shawn Singh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 17:18 PST by Shawn Singh
Modified: 2012-01-23 18:45 PST (History)
6 users (show)

See Also:


Attachments
Patch (6.66 KB, patch)
2012-01-18 19:45 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
addressed reviewer comments, removed unnecessary code in FakeTiledLayerEtc (7.34 KB, patch)
2012-01-19 17:54 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch for landing (7.19 KB, patch)
2012-01-20 16:59 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch for landing (7.19 KB, patch)
2012-01-22 15:49 PST, Shawn Singh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Singh 2011-11-21 17:18:31 PST
We should do the following
  (1) fix the bug, of course
  (2) re-name the transform conversion functions in the m_tiler - contentRectToLayerRect and layerRectToContentRect - so that they are clearer
  (3) add testing that the updateRect is computed correctly for the case where contentBounds != bounds.
Comment 1 Shawn Singh 2012-01-18 19:45:38 PST
Created attachment 123054 [details]
Patch
Comment 2 Shawn Singh 2012-01-18 19:46:23 PST
Note that (2) on the list above was already done by Enne in a previous patch.  This patch addresses (1) and (3).
Comment 3 Adrienne Walker 2012-01-19 11:12:51 PST
Comment on attachment 123054 [details]
Patch

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

In general, looks good.  Can you also leave a comment on LayerChromium::m_updateRect about what space it's supposed to be in?

> Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp:367
> +    // The updateRect (that indicates what was actually painted) should be in
> +    // layer space, not the "content space".

This is quite minor, but I'm kind of curious why content space gets scare quotes everywhere in this patch. Do you want to be calling it something else?
Comment 4 Shawn Singh 2012-01-19 17:54:44 PST
Created attachment 123228 [details]
addressed reviewer comments, removed unnecessary code in FakeTiledLayerEtc

Yeah, the reason I put quotes there is obsolete now anyway.  and I tend to overuse quotes, too.
Comment 5 Shawn Singh 2012-01-20 13:41:36 PST
Enne and James, could you please review?  Should be a relatively quick and easy review... thanks!
Comment 6 Adrienne Walker 2012-01-20 13:48:11 PST
Comment on attachment 123228 [details]
addressed reviewer comments, removed unnecessary code in FakeTiledLayerEtc

Thanks for the extra comment.  LGTM.
Comment 7 James Robinson 2012-01-20 14:40:11 PST
Comment on attachment 123228 [details]
addressed reviewer comments, removed unnecessary code in FakeTiledLayerEtc

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

R=me, some minor cleanups suggested

> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:245
> +    float widthScale = bounds().width() / static_cast<double>(contentBounds().width());
> +    float heightScale = bounds().height() / static_cast<double>(contentBounds().height());

nit: if we're assigning to a float, why static_cast<> to double? why not float?

> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:246
> +    m_updateRect = FloatRect(m_paintRect.x() * widthScale, m_paintRect.y() * heightScale, m_paintRect.width() * widthScale, m_paintRect.height() * heightScale);

nit: i think i'd weakly prefer doing something like FloatRect(m_paintRect).scale(widthScale, heightScale); just to make the line a bit shorter and have less risk of silly copy/paste errors
Comment 8 Shawn Singh 2012-01-20 16:59:01 PST
Created attachment 123414 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-01-20 17:01:51 PST
Comment on attachment 123414 [details]
Patch for landing

Rejecting attachment 123414 [details] from commit-queue.

shawnsingh@chromium.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 10 Shawn Singh 2012-01-22 15:49:44 PST
Created attachment 123501 [details]
Patch for landing
Comment 11 WebKit Review Bot 2012-01-23 18:45:19 PST
Comment on attachment 123501 [details]
Patch for landing

Clearing flags on attachment: 123501

Committed r105680: <http://trac.webkit.org/changeset/105680>
Comment 12 WebKit Review Bot 2012-01-23 18:45:24 PST
All reviewed patches have been landed.  Closing bug.