Closed
Bug 1207944
Opened 9 years ago
Closed 9 years ago
Remove gfxRGBA (part 1)
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
(Blocks 1 open bug)
Details
Attachments
(10 files)
3.18 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
6.79 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
2.17 KB,
patch
|
jwatt
:
review-
|
Details | Diff | Splinter Review |
16.81 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
3.89 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
1.72 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
13.29 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
10.11 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
4.49 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
1.76 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
I have a stack of 22 patches that remove gfxRGBA from the tree. I'll do the first batch in this bug.
![]() |
Assignee | |
Comment 1•9 years ago
|
||
Attachment #8665288 -
Flags: review?(bas)
![]() |
Assignee | |
Comment 2•9 years ago
|
||
This requires doing likewise for GetSolidColor(), PushSolidColor()
HasNonOpaqueColor().
This removes a ThebesRGBA() call in GetDeviceColor() and a ThebesColor() call in
GetSolidColor().
Attachment #8665289 -
Flags: review?(bas)
![]() |
Assignee | |
Comment 3•9 years ago
|
||
The existing one, which takes a gfxRGBA&, will be removed a few patches hence.
Attachment #8665290 -
Flags: review?(bas)
![]() |
Assignee | |
Comment 4•9 years ago
|
||
Attachment #8665292 -
Flags: review?(matt.woodrow)
![]() |
Assignee | |
Comment 5•9 years ago
|
||
Attachment #8665293 -
Flags: review?(bas)
![]() |
Assignee | |
Comment 6•9 years ago
|
||
Attachment #8665295 -
Flags: review?(matt.woodrow)
![]() |
Assignee | |
Comment 7•9 years ago
|
||
Attachment #8665309 -
Flags: review?(matt.woodrow)
![]() |
Assignee | |
Comment 8•9 years ago
|
||
Attachment #8665312 -
Flags: review?(bas)
![]() |
Assignee | |
Comment 9•9 years ago
|
||
Attachment #8665313 -
Flags: review?(matt.woodrow)
![]() |
Assignee | |
Comment 10•9 years ago
|
||
Attachment #8665314 -
Flags: review?(bas)
![]() |
||
Comment 11•9 years ago
|
||
Comment on attachment 8665290 [details] [diff] [review]
(part 3) - Add a gfxContext::SetColor method that takes a gfx::Color&
You need to call ToDeviceColor() call in the new function too. Consider this an r+ with that added.
Attachment #8665290 -
Flags: review?(bas) → review-
![]() |
||
Comment 12•9 years ago
|
||
Comment on attachment 8665288 [details] [diff] [review]
(part 1) - Pass a gfx::Color& instead of a gfxRGBA& to SetDeviceColor()
Might as well r+ these since I read them too.
Attachment #8665288 -
Flags: review?(bas) → review+
![]() |
||
Updated•9 years ago
|
Attachment #8665289 -
Flags: review?(bas) → review+
![]() |
||
Updated•9 years ago
|
Attachment #8665293 -
Flags: review?(bas) → review+
![]() |
||
Updated•9 years ago
|
Attachment #8665292 -
Flags: review?(matt.woodrow) → review+
![]() |
||
Updated•9 years ago
|
Attachment #8665295 -
Flags: review?(matt.woodrow) → review+
![]() |
||
Comment 13•9 years ago
|
||
Comment on attachment 8665309 [details] [diff] [review]
(part 7) - Use gfx::Color instead of gfxRGBA in ColorStop
Review of attachment 8665309 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsCSSRendering.cpp
@@ +2588,5 @@
> // Compute how far the new position 0.0 is along the interval
> // between pos and nextPos.
> // XXX Color interpolation (in cairo, too) should use the
> // CSS 'color-interpolation' property!
> + float frac = float((0.0 - pos)/(nextPos - pos));
It doesn't look like 'pos' and 'nextPos' need to be double (or ColorStop.mPosition), but you don't need to change that now I guess.
Attachment #8665309 -
Flags: review?(matt.woodrow) → review+
![]() |
||
Comment 14•9 years ago
|
||
Comment on attachment 8665312 [details] [diff] [review]
(part 8) - Use gfx::Color instead of gfxRGBA in BlurCache
Review of attachment 8665312 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxBlur.h
@@ +128,5 @@
> static void BlurRectangle(gfxContext *aDestinationCtx,
> const gfxRect& aRect,
> RectCornerRadii* aCornerRadii,
> const gfxPoint& aBlurStdDev,
> + const mozilla::gfx::Color& aShadowColor,
Add a typedef like the one for RectCornerRadii at the beginning of the class declaration.
Attachment #8665312 -
Flags: review?(bas) → review+
![]() |
||
Comment 15•9 years ago
|
||
Comment on attachment 8665313 [details] [diff] [review]
(part 9) - Change nsDisplayBackgroundColor::mColor from gfxRGBA to gfx::Color
Review of attachment 8665313 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsDisplayList.cpp
@@ +2988,5 @@
> void
> nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
> nsRenderingContext* aCtx)
> {
> + if (mColor == Color()) {
Personally I'd prefer Color(0.f, 0.f, 0.f) to be clear, but if the defaults are there I guess others disagrees, so either way.
Attachment #8665313 -
Flags: review?(matt.woodrow) → review+
![]() |
||
Comment 16•9 years ago
|
||
Comment on attachment 8665314 [details] [diff] [review]
(part 10) - Remove SetColor(const gfxRGBA&)
Review of attachment 8665314 [details] [diff] [review]:
-----------------------------------------------------------------
\o/
Attachment #8665314 -
Flags: review?(bas) → review+
![]() |
Assignee | |
Comment 17•9 years ago
|
||
jwatt: thank you for the fast and unexpected reviews :)
> (part 3) - Add a gfxContext::SetColor method that takes a gfx::Color&
>
> You need to call ToDeviceColor() call in the new function too.
Good catch.
> > + float frac = float((0.0 - pos)/(nextPos - pos));
>
> It doesn't look like 'pos' and 'nextPos' need to be double (or
> ColorStop.mPosition), but you don't need to change that now I guess.
I considered it but changing mPosition would have propagated through to a lot more places so I left it alone for now. I'll add it to my list of things to fix later.
> Add a typedef like the one for RectCornerRadii at the beginning of the class
> declaration.
Will do.
> > + if (mColor == Color()) {
>
> Personally I'd prefer Color(0.f, 0.f, 0.f) to be clear, but if the defaults
> are there I guess others disagrees, so either way.
Careful! Color(0,0,0) gives opaque black. Color() is equivalent to Color(0,0,0,0) which is transparent black.
Thinking some more, the special-casing of transparent black here is strange to me... I would have thought any transparent colour would trigger the early return case here. But I don't want to combine functional changes with this refactoring so I'll leave it alone.
![]() |
||
Comment 18•9 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #17)
> Careful! Color(0,0,0) gives opaque black. Color() is equivalent to
> Color(0,0,0,0) which is transparent black.
Haha, there you go. ;)
> Thinking some more, the special-casing of transparent black here is strange
> to me... I would have thought any transparent colour would trigger the early
> return case here. But I don't want to combine functional changes with this
> refactoring so I'll leave it alone.
I wasn't suggesting getting rid of the default values, but rather that you continue to pass values explicitly rather than rely on them.
![]() |
Assignee | |
Comment 19•9 years ago
|
||
I rebased after bug 1188075 landed. Part 6 disappeared and I had to remove some more ThebesColor() calls in part 7. I'll rename bugs 7--10 before landing.
Comment 20•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/619a48655962
https://hg.mozilla.org/integration/mozilla-inbound/rev/a6d617597f21
https://hg.mozilla.org/integration/mozilla-inbound/rev/49006d284866
https://hg.mozilla.org/integration/mozilla-inbound/rev/bbfb007252f1
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e4a409f1dcd
Comment 21•9 years ago
|
||
Comment 22•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/619a48655962
https://hg.mozilla.org/mozilla-central/rev/a6d617597f21
https://hg.mozilla.org/mozilla-central/rev/49006d284866
https://hg.mozilla.org/mozilla-central/rev/bbfb007252f1
https://hg.mozilla.org/mozilla-central/rev/3e4a409f1dcd
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Comment 23•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•