Bug 23512 - cgColor() should have 'copy' or 'create' in the name (or return a RetainPtr)
Summary: cgColor() should have 'copy' or 'create' in the name (or return a RetainPtr)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-23 20:49 PST by Simon Fraser (smfr)
Modified: 2009-03-02 11:51 PST (History)
1 user (show)

See Also:


Attachments
Patch (7.69 KB, patch)
2009-02-26 06:41 PST, Jeremy Moskovich
eric: review+
Details | Formatted Diff | Diff
PLATFORM(WIN_OS) (7.69 KB, patch)
2009-02-27 10:18 PST, Jeremy Moskovich
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-01-23 20:49:37 PST
cgColor() returns a retained object, but the name doesn't communicate that. Bad!
Comment 1 Simon Fraser (smfr) 2009-01-23 21:52:28 PST
Also the implementation of 
    Color(CGColorRef);
is totally missing!
Comment 2 Simon Fraser (smfr) 2009-01-24 10:37:24 PST
Odd. ColorCG.cpp exists, but is not in the Xcode project. It also has an implementation of cgColor() that uses the platform color space.
Comment 3 Jeremy Moskovich 2009-02-26 06:41:13 PST
Created attachment 28014 [details]
Patch

Rename to createCGColor() per-irc conversation.

This also fixes https://bugs.webkit.org/show_bug.cgi?id=24197
Comment 4 Eric Seidel (no email) 2009-02-26 11:37:41 PST
Comment on attachment 28014 [details]
Patch

Yay!  I like this change. Of course I might get yelled at by bdash for my continued disparate understanding of PLATFORM(MAC) vs. PLATFORM(DARWIN). :(
Comment 5 Darin Adler 2009-02-26 11:41:23 PST
DARWIN really seems wrong to me for the uses of CMProfileRef. For now, maybe !WIN_OS would be better, since the more limited version of CG is the one on Windows.
Comment 6 Jeremy Moskovich 2009-02-27 10:18:53 PST
Created attachment 28078 [details]
PLATFORM(WIN_OS)

Fix per Darin's comments.
Comment 7 Simon Fraser (smfr) 2009-02-27 10:23:02 PST
Comment on attachment 28078 [details]
PLATFORM(WIN_OS)

r=me
Comment 8 David Levin 2009-03-01 16:42:41 PST
Comitted as r41345.