Bug 13505 - loses precision on x86_64
Summary: loses precision on x86_64
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 11:06 PDT by Kulyk Nazar
Modified: 2007-04-26 22:32 PDT (History)
0 users

See Also:


Attachments
graphicscontextcairo-user_data-fix.patch (1.45 KB, patch)
2007-04-26 11:08 PDT, Kulyk Nazar
mjs: review-
Details | Formatted Diff | Diff
Use a stack of opacity values (2.38 KB, patch)
2007-04-26 14:49 PDT, Alp Toker
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.