Bug 13505

Summary: loses precision on x86_64
Product: WebKit Reporter: Kulyk Nazar <schamane>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
graphicscontextcairo-user_data-fix.patch
mjs: review-
Use a stack of opacity values mjs: review+

Description Kulyk Nazar 2007-04-26 11:06:38 PDT
../../platform/graphics/cairo/GraphicsContextCairo.cpp:595: error: cast from ‘void*’ to ‘unsigned int’ loses precision

On compiling gdk port on x86_64.
Comment 1 Kulyk Nazar 2007-04-26 11:08:04 PDT
Created attachment 14205 [details]
graphicscontextcairo-user_data-fix.patch

Allocate float for user_set_ and _get_ data for opacity.
Comment 2 Alp Toker 2007-04-26 11:56:38 PDT
A few thoughts.

You should remove the comment about storing the opacity value directly now that this isn't the case.

The ASSERT(opacity >= 0 && opacity <= 1) checks are no longer relevant either.

Also, we try to use C++ style casts rather than C style.

I think you can do direct assignment and leave casting to void* until later, avoiding the memcpy (which has mis-formatted whitespace in your patch).

The final patch will need a ChangeLog entry -- see the 'prepare-ChangeLog' script.

Thanks
Comment 3 Maciej Stachowiak 2007-04-26 12:42:24 PDT
Comment on attachment 14205 [details]
graphicscontextcairo-user_data-fix.patch

It's pretty inefficient to malloc the size of a single float; better to use a separate Vector<float> as a stack in the GraphicsContext.
Comment 4 Alp Toker 2007-04-26 14:49:19 PDT
Created attachment 14212 [details]
Use a stack of opacity values
Comment 5 Maciej Stachowiak 2007-04-26 22:28:17 PDT
Comment on attachment 14212 [details]
Use a stack of opacity values

Noce, that's actually less code even.

r=me
Comment 6 Mark Rowe (bdash) 2007-04-26 22:32:09 PDT
Landed in r21134.