[Webkit-unassigned] [Bug 89138] [cairo] improve putByteArray speed by avoiding max/min checks at Color construction.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 19 17:34:47 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89138





--- Comment #9 from arno. <arno at renevier.net>  2012-06-19 17:34:47 PST ---
(In reply to comment #4)
> (From update of attachment 148385 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=148385&action=review
> 
> > Source/WebCore/platform/graphics/Color.h:75
> > +inline RGBA32 makeRGBUnsafe(int r, int g, int b)
> > +{
> > +    return 0xFF000000 | r << 16 | g << 8 | b;
> > +}
> > +
> > +inline RGBA32 makeRGBAUnsafe(int r, int g, int b, int a)
> > +{
> > +    return a << 24 | r << 16 | g << 8 | b;
> > +}
> > +
> 
> Why not simply override these methods as well to take unsigneds?

Because some parts of the code call makeRGB(float, ), and if we make makeRGB(unsigned char), those calls would become redundant. Also, maybe in some cases, it would be convenient to call makeRGBUnsafe with integers if we already known those integers are between 0 and 255 (I'm thinking for example at the colorFromPremultipliedARGB function)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list