As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 537223 - Cleanup of gfxColor.h
: Cleanup of gfxColor.h
: footprint
Product: Core
Classification: Components
Component: GFX: Color Management (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: :Ms2ger (⌚ UTC+1/+2)
: Milan Sreckovic [:milan]
Depends on:
Blocks: deadcode
  Show dependency treegraph
Reported: 2009-12-30 04:19 PST by Alfred Kayser
Modified: 2011-08-25 06:57 PDT (History)
4 users (show)
Ms2ger: in‑testsuite-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

V1: Cleanup of gfxRGBA in gfxColor.h (5.75 KB, patch)
2009-12-30 04:41 PST, Alfred Kayser
jmuizelaar: review+
Details | Diff | Splinter Review
Patch v2 (10.76 KB, patch)
2011-08-22 03:32 PDT, :Ms2ger (⌚ UTC+1/+2)
jmuizelaar: review+
Details | Diff | Splinter Review

Description User image Alfred Kayser 2009-12-30 04:19:53 PST
gfxRGBA has some things that can be cleaned out.

Not Used:
266     /**
267      * Convert this color to a hex value. For example, for rgb(255,0,0),
268      * this will return FF0000.
269      */
270     // XXX I'd really prefer to just have this return an nsACString
271     // Does this function even make sense, since we're just ignoring the alpha value?
272     void Hex(nsACString& result) const {
273         nsPrintfCString hex(8, "%02x%02x%02x", PRUint8(r*255.0), PRUint8(g*255.0), PRUint8(b*255.0));
274         result.Assign(hex);
275     }
276 #endif
42 #include "nsPrintfCString.h"
43 #endif

Not implemented, and also not used:
222     /**
223      * Initialize this color by parsing the given string.
224      * XXX implement me!
225      */
226 #if 0
227     gfxRGBA(const char* str) {
228         a = 1.0;
229         // if aString[0] is a #, parse it as hex
230         // if aString[0] is a letter, parse it as a color name
231         // if aString[0] is a number, parse it loosely as hex
232     }
233 #endif

Not used:
Comment 1 User image Alfred Kayser 2009-12-30 04:41:30 PST
Created attachment 419555 [details] [diff] [review]
V1: Cleanup of gfxRGBA in gfxColor.h

Note, the removal of #include nsPrintfCString.h requires the addition of #include nsString.h in gfxPlatform, as that one uses nsString.
Comment 2 User image Jeff Muizelaar [:jrmuizel] 2010-01-28 08:19:16 PST
I'd prefer if you got Vlad and/or Stuart to review these changes because they put the unused code in.
Comment 3 User image :Ms2ger (⌚ UTC+1/+2) 2011-08-12 03:45:56 PDT
Comment on attachment 419555 [details] [diff] [review]
V1: Cleanup of gfxRGBA in gfxColor.h

Doesn't look like they are going to do their review duty, back to you.
Comment 4 User image Jeff Muizelaar [:jrmuizel] 2011-08-16 09:22:03 PDT
Comment on attachment 419555 [details] [diff] [review]
V1: Cleanup of gfxRGBA in gfxColor.h

Why not.
Comment 5 User image Mozilla RelEng Bot 2011-08-19 12:10:50 PDT
Try run for bb4988e00b64 is complete.
Detailed breakdown of the results available here:
Results (out of 17 total builds):
    failure: 17
Builds available at
Comment 6 User image :Ms2ger (⌚ UTC+1/+2) 2011-08-22 03:32:02 PDT
Created attachment 554812 [details] [diff] [review]
Patch v2

Turned out that PACKED_XRGB was used after all. I added it back and fixed up a couple of #include problems. Sorry about that.
Comment 7 User image :Ms2ger (⌚ UTC+1/+2) 2011-08-22 03:32:45 PDT
(It does pass try now: <>.)
Comment 8 User image :Ms2ger (⌚ UTC+1/+2) 2011-08-25 06:57:51 PDT

Note You need to log in before you can comment on or make changes to this bug.