WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
64754
Rename FloatSize to GraphicsSize
https://bugs.webkit.org/show_bug.cgi?id=64754
Summary
Rename FloatSize to GraphicsSize
Levi Weintraub
Reported
2011-07-18 14:31:31 PDT
The first class to be renamed (to cut down on patch size).
Attachments
Patch
(287.09 KB, patch)
2011-07-18 14:51 PDT
,
Levi Weintraub
no flags
Details
Formatted Diff
Diff
Patch
(366.30 KB, patch)
2011-07-18 15:07 PDT
,
Levi Weintraub
leviw
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Levi Weintraub
Comment 1
2011-07-18 14:51:21 PDT
Created
attachment 101207
[details]
Patch
WebKit Review Bot
Comment 2
2011-07-18 14:56:29 PDT
Attachment 101207
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/CMakeLists.txt', u'Source/W..." exit_code: 1 Source/WebKit2/Shared/WebEvent.h:182: The parameter name "phase" adds no information, so it should be removed. [readability/parameter_name] [5] Source/WebKit2/Shared/WebEvent.h:182: Missing space after , [whitespace/comma] [3] Total errors found: 2 in 155 files If any of these errors are false positives, please file a bug against check-webkit-style.
Levi Weintraub
Comment 3
2011-07-18 15:07:05 PDT
Created
attachment 101214
[details]
Patch
Levi Weintraub
Comment 4
2011-07-18 16:55:32 PDT
Any comments/review would be much appreciated.
Levi Weintraub
Comment 5
2011-07-26 11:03:13 PDT
(In reply to
comment #4
)
> Any comments/review would be much appreciated.
Ping?
Levi Weintraub
Comment 6
2011-07-27 11:34:57 PDT
Simon, it'd be great if you could take a look at this.
Darin Adler
Comment 7
2011-07-27 12:17:55 PDT
Renaming the class seems wrong. Is a graphics-system-specific floating point size the only case where we want a floating point size? At the moment we use FloatSize a lot in WebKit, and on Mac OS X under 64-bit the graphics system size would be a DoubleSize, not a FloatSize. I am not sure that renaming is the right way to go here; we might need both or to use typedefs.
Simon Fraser (smfr)
Comment 8
2011-07-27 12:22:45 PDT
(In reply to
comment #7
)
> Renaming the class seems wrong. Is a graphics-system-specific floating point size the only case where we want a floating point size? At the moment we use FloatSize a lot in WebKit, and on Mac OS X under 64-bit the graphics system size would be a DoubleSize, not a FloatSize. I am not sure that renaming is the right way to go here; we might need both or to use typedefs.
I agree. I also think that we might want to use floats for layout, but CGFloat for GraphicsContext etc (i.e. double on 64-bit).
Levi Weintraub
Comment 9
2011-07-27 12:27:34 PDT
(In reply to
comment #7
)
> Renaming the class seems wrong. Is a graphics-system-specific floating point size the only case where we want a floating point size? At the moment we use FloatSize a lot in WebKit, and on Mac OS X under 64-bit the graphics system size would be a DoubleSize, not a FloatSize. I am not sure that renaming is the right way to go here; we might need both or to use typedefs.
I wouldn't be particularly excited to create a whole new class for DoubleSize and such. At that point it seems like a template would be the answer, and we could always do something like: typedef Size<float> FloatSize; and maybe typedef Size<CGFloat> GraphicsSize; on Mac? Any thoughts? I'm also not sure that moving the Int* classes into a set of template specializations would be a win for simplicity, but I'm open to the thought and willing to give it a try.
Darin Adler
Comment 10
2011-07-27 12:30:18 PDT
Template classes tend to make function names much longer for things like the .exp files and debugging much less pleasant. If we can mitigate that issue, then I think a template is fine.
Levi Weintraub
Comment 11
2011-07-27 12:30:26 PDT
Comment on
attachment 101214
[details]
Patch Sounds like this one isn't the answer. Taking off the r?. I'll give templating a try unless there's pushback.
Levi Weintraub
Comment 12
2011-07-27 12:33:01 PDT
(In reply to
comment #10
)
> Template classes tend to make function names much longer for things like the .exp files and debugging much less pleasant. If we can mitigate that issue, then I think a template is fine.
I agree. It just *seems* cleaner than creating a clone of the Float* classes that just substitute Double... I'm honestly not sure how to make dealing with templates less of a pain though :(
Levi Weintraub
Comment 13
2011-07-29 14:21:48 PDT
I wanted to have something like this: #if (USE(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROMIUM)) && defined(CGFLOAT_IS_DOUBLE) typedef DoubleRect GraphicsRect; #else typedef FloatRect GraphicsRect; #endif But many graphics functions are exported, and we can't export a typedef that changed like that (that I know of?). How important is it really to convert the GraphicsContext to CGFloat on Mac platforms? It doesn't seem like this will grant us any more precision, but only scale up to doubles on 64 bit platforms one step earlier than it does currently.
Darin Adler
Comment 14
2011-07-29 18:14:33 PDT
(In reply to
comment #13
)
> #if (USE(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROMIUM)) && defined(CGFLOAT_IS_DOUBLE) > typedef DoubleRect GraphicsRect; > #else > typedef FloatRect GraphicsRect; > #endif > > But many graphics functions are exported, and we can't export a typedef that changed like that (that I know of?).
On Mac we have #if statements in our exp files. And we have various techniques to deal with the fact that CGFloat is a typedef.
> How important is it really to convert the GraphicsContext to CGFloat on Mac platforms?
If that’s not what GraphicsRect means, then why not use FloatRect everywhere?
Levi Weintraub
Comment 15
2012-02-27 09:09:46 PST
We no longer are taking this tact.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug