Closed
Bug 930451
Opened 12 years ago
Closed 12 years ago
SVG doesn't cache its gradient stops
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: gal, Assigned: gal)
References
(Blocks 1 open bug)
Details
(Whiteboard: [qa-])
Attachments
(3 files, 7 obsolete files)
|
10.92 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
|
4.02 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
|
18.09 KB,
patch
|
roc
:
review+
lsblakk
:
approval-mozilla-aurora+
lsblakk
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Azure backends rely on this for caching. I will factor out the caching code in nsCSSRendering and then use that for SVG as well. nsCSSRenderingBorders has its own cache, thats fine I guess, because those gradients are kinda special.
| Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → gal
| Assignee | ||
Comment 2•12 years ago
|
||
| Assignee | ||
Comment 3•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Attachment #821910 -
Flags: review?(roc)
| Assignee | ||
Updated•12 years ago
|
Attachment #821912 -
Flags: review?(roc)
| Assignee | ||
Updated•12 years ago
|
Attachment #821914 -
Flags: review?(roc)
Comment on attachment 821910 [details] [diff] [review]
Part 1: Factor out CSS gradient cache into a new class Rendering
Review of attachment 821910 [details] [diff] [review]:
-----------------------------------------------------------------
Did you forget to "hg add" the new files?
Attachment #821910 -
Flags: review?(roc) → review-
| Assignee | ||
Comment 5•12 years ago
|
||
Amateur mistake. How embarrassing. Sigh.
Attachment #821910 -
Attachment is obsolete: true
Attachment #821967 -
Flags: review?(roc)
| Assignee | ||
Comment 6•12 years ago
|
||
Attachment #821912 -
Attachment is obsolete: true
Attachment #821912 -
Flags: review?(roc)
Attachment #821968 -
Flags: review?(roc)
| Assignee | ||
Comment 7•12 years ago
|
||
Attachment #821914 -
Attachment is obsolete: true
Attachment #821914 -
Flags: review?(roc)
Attachment #821970 -
Flags: review?(roc)
Comment 8•12 years ago
|
||
Comment on attachment 821967 [details] [diff] [review]
Part 1: Factor out CSS gradient cache into a new class Rendering
Review of attachment 821967 [details] [diff] [review]:
-----------------------------------------------------------------
Driving by...
What else is planned for the Rendering class? I'm asking because it has a very general name, so I'm anticipating more things are coming. If that's the case, it may be worth putting a comment in the class header to cover this...
::: layout/base/Rendering.h
@@ +16,5 @@
> + static void Shutdown();
> +
> + static Rendering &Instance();
> +
> + gfx::GradientStops *GetGradientStops(gfx::DrawTarget *aDT,
You may get called on the white space usage of "Class *var" instead of "Class* var", but I think all of those are inherited from the cut and paste code, so that may be a way to leave it?
Comment on attachment 821967 [details] [diff] [review]
Part 1: Factor out CSS gradient cache into a new class Rendering
Review of attachment 821967 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/Rendering.h
@@ +4,5 @@
> + * License, v. 2.0. If a copy of the MPL was not distributed with this
> + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
> +
> +#include "nsTArray.h"
> +#include "gfxPattern.h"
I don't think you need to #include gfxPattern.h.
@@ +9,5 @@
> +#include "mozilla/gfx/2D.h"
> +
> +namespace mozilla {
> +
> +class Rendering {
This needs a more descriptive name.
LayoutGradientCache?
@@ +14,5 @@
> +public:
> + static void Init();
> + static void Shutdown();
> +
> + static Rendering &Instance();
We don't need an instance of this class. Just make the methods static.
Attachment #821967 -
Flags: review?(roc) → review-
Attachment #821968 -
Flags: review?(roc) → review+
Comment on attachment 821970 [details] [diff] [review]
Part 3: Use the Rendering gradient cache for SVG gradients as well.
Review of attachment 821970 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxPattern.cpp
@@ +106,5 @@
> + gfxGradientCache &aCache)
> +{
> + if (mPattern) {
> + mStops = nullptr;
> + nsTArray<GradientStop> stops;
nsAutoTArray<GradientStop,3> or something like that
@@ +120,5 @@
> + mStops = aCache.GetOrCreateGradientStops(aDT,
> + stops,
> + (cairo_pattern_get_extend(mPattern) == CAIRO_EXTEND_REPEAT)
> + ? mozilla::gfx::EXTEND_REPEAT
> + : mozilla::gfx::EXTEND_CLAMP);
This file should have "using mozilla::gfx;" if it doesn't already so we don't have to use these prefixes.
Attachment #821970 -
Flags: review?(roc) → review+
Comment on attachment 821967 [details] [diff] [review]
Part 1: Factor out CSS gradient cache into a new class Rendering
Review of attachment 821967 [details] [diff] [review]:
-----------------------------------------------------------------
Actually, since you're going to use this from gfx, I think it should live in gfx.
| Assignee | ||
Comment 12•12 years ago
|
||
Rendering was meant as an abstraction nsCSSRendering and something equivalent for SVG rendering (nsSVGRendering, we just don't have it) into -> Rendering, that is used by both. As usual, I am totally neutral on naming. I will name it anything you want.
I think we should move it to gfx/thebes and call it gfxGradientCache.
| Assignee | ||
Comment 14•12 years ago
|
||
I thought we are deleting thebes? Happy to do it but isn't gfx/src better?
There's a lot of stuff in gfx/thebes that's not gfxContext-related (e.g. all of our text stuff). I'd put it there with a gfx prefix (like gfxGradientCache), and we can have a reshuffling at some point in the future when we're bored :)
| Assignee | ||
Comment 16•12 years ago
|
||
Attachment #821967 -
Attachment is obsolete: true
Attachment #822664 -
Flags: review?(roc)
| Assignee | ||
Comment 17•12 years ago
|
||
Attachment #821968 -
Attachment is obsolete: true
Attachment #822665 -
Flags: review+
| Assignee | ||
Comment 18•12 years ago
|
||
Attachment #821970 -
Attachment is obsolete: true
Attachment #822666 -
Flags: review+
| Assignee | ||
Comment 19•12 years ago
|
||
Attachment #822664 -
Attachment is obsolete: true
Attachment #822664 -
Flags: review?(roc)
Attachment #822668 -
Flags: review?(roc)
Attachment #822668 -
Flags: review?(roc) → review+
Comment 20•12 years ago
|
||
Fixed some test failures and crashes, and landed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e981813e29a8
https://hg.mozilla.org/integration/mozilla-inbound/rev/74a6f39a79e6
https://hg.mozilla.org/integration/mozilla-inbound/rev/1574b1da1773
Comment 21•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e981813e29a8
https://hg.mozilla.org/mozilla-central/rev/74a6f39a79e6
https://hg.mozilla.org/mozilla-central/rev/1574b1da1773
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment 22•12 years ago
|
||
Backports on top of bug 934860:
Aurora: https://tbpl.mozilla.org/?tree=Try&rev=72effc5856f0
Beta: https://tbpl.mozilla.org/?tree=Try&rev=c13c3ee1695c
Comment 23•12 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #22)
> Backports on top of bug 934860:
> Aurora: https://tbpl.mozilla.org/?tree=Try&rev=72effc5856f0
> Beta: https://tbpl.mozilla.org/?tree=Try&rev=c13c3ee1695c
Had to do another beta push due to Try not liking to build Windows off beta with the switch to rev2 build slaves.
https://tbpl.mozilla.org/?tree=Try&rev=0059fd7074b6
The good news is that we're all green :)
Comment 24•12 years ago
|
||
Comment on attachment 822668 [details] [diff] [review]
Part 1: Factor out CSS gradient cache into a new class gfxGradientCache
[Approval Request Comment]
Bug caused by (feature/regressing bug #): None, but fixes a performance regression caused by bug 934860
User impact if declined: SVG gradient performance regression if uplift bug 934860.
Testing completed (on m-c, etc.): Been on m-c for a few days, Ryan has done try pushes for aurora/beta that came back green.
Risk to taking this patch (and alternatives if risky): Should be fairly low risk, mostly just refactoring and then caching gradients in one extra place.
String or IDL/UUID changes made by this patch: None
Attachment #822668 -
Flags: approval-mozilla-beta?
Attachment #822668 -
Flags: approval-mozilla-aurora?
Updated•12 years ago
|
Attachment #822668 -
Flags: approval-mozilla-beta?
Attachment #822668 -
Flags: approval-mozilla-beta+
Attachment #822668 -
Flags: approval-mozilla-aurora?
Attachment #822668 -
Flags: approval-mozilla-aurora+
Comment 25•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/019969972ed0
https://hg.mozilla.org/releases/mozilla-aurora/rev/a3bb77bde73f
https://hg.mozilla.org/releases/mozilla-aurora/rev/e94179cf1740
https://hg.mozilla.org/releases/mozilla-beta/rev/93a81f9ea22f
https://hg.mozilla.org/releases/mozilla-beta/rev/9ca1991e2e5c
https://hg.mozilla.org/releases/mozilla-beta/rev/0aff8f2eff7e
Comment 26•12 years ago
|
||
Updated•12 years ago
|
status-b2g-v1.2:
--- → fixed
Updated•12 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•