Bug 23512

Summary: cgColor() should have 'copy' or 'create' in the name (or return a RetainPtr)
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
eric: review+
PLATFORM(WIN_OS) simon.fraser: review+

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.