Bug 68722 - Implicit conversion double to float in ShadowBlur::adjustBlurRadius
Summary: Implicit conversion double to float in ShadowBlur::adjustBlurRadius
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Julien Chaffraix
URL:
Keywords: InRadar
Depends on: 68667
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-23 13:17 PDT by Julien Chaffraix
Modified: 2011-09-27 13:33 PDT (History)
4 users (show)

See Also:


Attachments
Proposed build fix: add 2 variables with the proper cast. (1.52 KB, patch)
2011-09-23 13:20 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff
fix 2.... (1.43 KB, patch)
2011-09-23 13:42 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2011-09-23 13:17:04 PDT
This is making the Intel Mac Debug bot bad. Let's make add an explicit conversion to calm the bots.
Comment 1 Julien Chaffraix 2011-09-23 13:20:45 PDT
Created attachment 108524 [details]
Proposed build fix: add 2 variables with the proper cast.
Comment 2 Simon Fraser (smfr) 2011-09-23 13:29:59 PDT
Comment on attachment 108524 [details]
Proposed build fix: add 2 variables with the proper cast.

I think m_blurRadius.scale(1 / static_cast<float>(transform.xScale()), 1 / static_cast<float>(transform.yScale())); would be better.
Comment 3 Julien Chaffraix 2011-09-23 13:42:29 PDT
Created attachment 108528 [details]
fix 2....
Comment 4 Darin Adler 2011-09-23 15:43:41 PDT
Rather than a cast we could use narrowPrecisionToFloat next time.
Comment 5 Simon Fraser (smfr) 2011-09-23 15:48:33 PDT
We're not consistent about using narrowPrecisionToFloat(). It seems to have little value. narrowPrecisionToCGFloat, on the other hand, has obvious value.
Comment 6 WebKit Review Bot 2011-09-23 16:11:00 PDT
Comment on attachment 108528 [details]
fix 2....

Clearing flags on attachment: 108528

Committed r95879: <http://trac.webkit.org/changeset/95879>
Comment 7 WebKit Review Bot 2011-09-23 16:11:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2011-09-23 20:33:01 PDT
(In reply to comment #5)
> We're not consistent about using narrowPrecisionToFloat(). It seems to have little value.

It has value in that you can easily see at the call site that it's not some other kind of static_cast, say from int to float.

> narrowPrecisionToCGFloat, on the other hand, has obvious value.

What value over calling static_cast<CGFloat>? The two situations seem entirely analogous to me.
Comment 9 Simon Fraser (smfr) 2011-09-23 20:38:39 PDT
(In reply to comment #8)
> (In reply to comment #5)
> > We're not consistent about using narrowPrecisionToFloat(). It seems to have little value.
> 
> It has value in that you can easily see at the call site that it's not some other kind of static_cast, say from int to float.

Then we should use it more consistently!

> > narrowPrecisionToCGFloat, on the other hand, has obvious value.
> 
> What value over calling static_cast<CGFloat>? The two situations seem entirely analogous to me.

Now that I think about it, you're right. I was thinking that it eliminated some float/double confusion.
Comment 10 David Harrison 2011-09-27 13:33:51 PDT
rdar://10184811