Bug 68722

Summary: Implicit conversion double to float in ShadowBlur::adjustBlurRadius
Product: WebKit Reporter: Julien Chaffraix <jchaffraix>
Component: PlatformAssignee: Julien Chaffraix <jchaffraix>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, harrison, simon.fraser, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 68667    
Bug Blocks:    
Attachments:
Description Flags
Proposed build fix: add 2 variables with the proper cast.
none
fix 2.... none

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