Bug 68669 - Remove unneeded type conversion from background bleed code
Summary: Remove unneeded type conversion from background bleed code
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: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 17:33 PDT by Darin Adler
Modified: 2011-09-23 09:59 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.84 KB, patch)
2011-09-22 17:33 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2011-09-22 17:33:13 PDT
Remove unneeded type conversion from background bleed code
Comment 1 Darin Adler 2011-09-22 17:33:55 PDT
Created attachment 108429 [details]
Patch
Comment 2 Geoffrey Garen 2011-09-22 17:38:09 PDT
Comment on attachment 108429 [details]
Patch

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

r=me

> Source/WebCore/rendering/RenderBoxModelObject.cpp:593
> +    adjustedRect.inflateX(-ceil(1 / transform.xScale()));
> +    adjustedRect.inflateY(-ceil(1 / transform.yScale()));

Maybe 1.0 would be clearer here.
Comment 3 Darin Adler 2011-09-22 17:44:51 PDT
Comment on attachment 108429 [details]
Patch

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

>> Source/WebCore/rendering/RenderBoxModelObject.cpp:593
>> +    adjustedRect.inflateY(-ceil(1 / transform.yScale()));
> 
> Maybe 1.0 would be clearer here.

I like the 1 fine. Using 1.0 would subtly impose a conversion to double if the other type happened to be float. I prefer to just leave it off.
Comment 4 WebKit Review Bot 2011-09-22 20:20:19 PDT
Comment on attachment 108429 [details]
Patch

Clearing flags on attachment: 108429

Committed r95778: <http://trac.webkit.org/changeset/95778>
Comment 5 WebKit Review Bot 2011-09-22 20:20:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Adam Roben (:aroben) 2011-09-23 05:16:40 PDT
Looks like this broke 32-bit builds, with warnings like the following:


WebCore/rendering/RenderBoxModelObject.cpp: In function 'WebCore::LayoutRect WebCore::backgroundRectAdjustedForBleedAvoidance(WebCore::GraphicsContext*, const WebCore::LayoutRect&, WebCore::BackgroundBleedAvoidance)':
WebCore/rendering/RenderBoxModelObject.cpp:592: warning: implicit conversion shortens 64-bit value into a 32-bit value
WebCore/rendering/RenderBoxModelObject.cpp:593: warning: implicit conversion shortens 64-bit value into a 32-bit value
Comment 7 Darin Adler 2011-09-23 09:54:01 PDT
(In reply to comment #6)
> Looks like this broke 32-bit builds, with warnings like the following:
> 
> 
> WebCore/rendering/RenderBoxModelObject.cpp: In function 'WebCore::LayoutRect WebCore::backgroundRectAdjustedForBleedAvoidance(WebCore::GraphicsContext*, const WebCore::LayoutRect&, WebCore::BackgroundBleedAvoidance)':
> WebCore/rendering/RenderBoxModelObject.cpp:592: warning: implicit conversion shortens 64-bit value into a 32-bit value
> WebCore/rendering/RenderBoxModelObject.cpp:593: warning: implicit conversion shortens 64-bit value into a 32-bit value

I’ll fix that right now.
Comment 8 Darin Adler 2011-09-23 09:55:30 PDT
I’ll fix this by adding a cast. But that warning seems pointless. And this has nothing to do with 32 vs. 64-bit builds. The type float is always 32 and the type double is always 64. I think it might even be a compiler bug.
Comment 9 Darin Adler 2011-09-23 09:59:11 PDT
(In reply to comment #6)
> Looks like this broke 32-bit builds

Thanks for the heads up, and thanks for not just rolling it out!