Closed
Bug 1044702
Opened 10 years ago
Closed 10 years ago
Use Moz2D source clipping when possible
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: mattwoodrow, Assigned: mattwoodrow)
References
Details
Attachments
(3 files, 1 obsolete file)
16.20 KB,
patch
|
seth
:
review+
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
7.07 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
8.17 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
Moz2D offers source clipping that covers some of the cases that we currently handle using CreateSamplingRestrictedDrawable.
We also previously had an optimization where we used a subimage instead of copying, that was broken by the moz2d conversion. Using Moz2D should let us get that performance back again.
Bug 1043560 simplifies the calling code a lot, so I'll base work on top of that.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee: nobody → matt.woodrow
Attachment #8463179 -
Flags: review?(bas)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8463180 -
Flags: review?(bas)
Assignee | ||
Comment 3•10 years ago
|
||
This is based on what I assume the needed moz2d API changes will (approximately) be like, and still needs to be rebased on top of bug 1043560
Assignee | ||
Updated•10 years ago
|
Attachment #8463179 -
Flags: review?(bas) → review?(seth)
Comment 4•10 years ago
|
||
Comment on attachment 8463179 [details] [diff] [review]
Part 1: Remove no longer needed gfxDrawable constructors
Review of attachment 8463179 [details] [diff] [review]:
-----------------------------------------------------------------
Man, doesn't this just fill you with joy?
::: gfx/thebes/gfxDrawable.h
@@ +62,5 @@
> const gfxRect& aFillRect,
> bool aRepeat,
> const GraphicsFilter& aFilter,
> const gfxMatrix& aTransform = gfxMatrix());
>
nit: kill this whitespace while you're at it.
Attachment #8463179 -
Flags: review+
Comment 5•10 years ago
|
||
Comment on attachment 8463180 [details] [diff] [review]
Part 2: Convert gfxSurfaceDrawable::Draw to moz2d
Review of attachment 8463180 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxDrawable.cpp
@@ -123,5 @@
> - aTransform.HasOnlyIntegerTranslation())
> - {
> - // If we only have integer translation, no special filtering needs to
> - // happen and we explicitly use FILTER_FAST. This is fast for some
> - // backends.
We're dropping this fast path. I wonder if that's going to hurt us anywhere. Perhaps we might as well keep it? (Using Filter::Point)
Attachment #8463180 -
Flags: review?(bas) → review+
Comment 6•10 years ago
|
||
Comment on attachment 8463179 [details] [diff] [review]
Part 1: Remove no longer needed gfxDrawable constructors
Review of attachment 8463179 [details] [diff] [review]:
-----------------------------------------------------------------
Can't wait for this stuff to land!
::: gfx/thebes/gfxDrawable.cpp
@@ +112,5 @@
> const GraphicsFilter& aFilter,
> const gfxMatrix& aTransform)
> {
> + nsRefPtr<gfxPattern> pattern = new gfxPattern(mSourceSurface, Matrix());
> +
Looks like there's some stray whitespace here.
::: gfx/thebes/gfxUtils.cpp
@@ +412,5 @@
> + aDrawable->Draw(tmpCtx, needed - needed.TopLeft(), true,
> + GraphicsFilter::FILTER_FAST, gfxMatrix().Translate(needed.TopLeft()));
> + RefPtr<SourceSurface> surface = target->Snapshot();
> +
> + return new gfxSurfaceDrawable(surface, size, gfxMatrix().Translate(-needed.TopLeft()));
This function returns an already_AddRefed<gfxDrawable>, so it's not safe to return the result of |new| directly here. (Indeed, does this compile? It looks like the raw pointer constructor of already_AddRefed<T> is explicit except on B2G.) The easiest solution is probably to switch back to using |forget()|.
::: image/src/VectorImage.cpp
@@ +933,5 @@
> ThebesIntRect(aParams.imageRect),
> ThebesIntRect(aParams.imageRect),
> SurfaceFormat::B8G8R8A8,
> GraphicsFilter::FILTER_NEAREST, aParams.flags);
> +
A little more whitespace here.
Attachment #8463179 -
Flags: review?(seth) → review+
Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8463180 [details] [diff] [review]
Part 2: Convert gfxSurfaceDrawable::Draw to moz2d
Review of attachment 8463180 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxDrawable.cpp
@@ -123,5 @@
> - aTransform.HasOnlyIntegerTranslation())
> - {
> - // If we only have integer translation, no special filtering needs to
> - // happen and we explicitly use FILTER_FAST. This is fast for some
> - // backends.
I think we dropped this quite a while ago. FILTER_FAST maps to Filter::LINEAR using http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfx2DGlue.h#89
We could bring it back, but that's probably a separate bug.
Assignee | ||
Updated•10 years ago
|
Keywords: leave-open
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Comment 10•10 years ago
|
||
This should improve correctness on mobile (since we don't do CSRD there), and performance for desktop platforms that support it efficiently (OSX, GDI, Direct2D 1.1).
https://tbpl.mozilla.org/?tree=Try&rev=301cc4346b13
Attachment #8463181 -
Attachment is obsolete: true
Attachment #8487717 -
Flags: review?(bas)
Updated•10 years ago
|
Attachment #8487717 -
Flags: review?(bas) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: leave-open
Assignee | ||
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Comment 13•10 years ago
|
||
Did this cause bug 1067311? Were crashing in this new code :(
Comment 14•10 years ago
|
||
Bas, is it worth backing this out to check if it's the cause for bug 1067311? (I understand Matt is on PTO, so asking the reviewer.)
Flags: needinfo?(matt.woodrow)
Flags: needinfo?(bas)
Comment 15•10 years ago
|
||
I thought we were backing it out for perf regressions anyway?
Flags: needinfo?(bas)
Comment 16•10 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #15)
> I thought we were backing it out for perf regressions anyway?
Doesn't look like anyone has done that. Given that bug 1067311 is the largest stability issue on Nightly atm, can you please make sure some action happens before the weekend?
Flags: needinfo?(bas)
Comment 17•10 years ago
|
||
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #16)
> (In reply to Bas Schouten (:bas.schouten) from comment #15)
> > I thought we were backing it out for perf regressions anyway?
>
> Doesn't look like anyone has done that. Given that bug 1067311 is the
> largest stability issue on Nightly atm, can you please make sure some action
> happens before the weekend?
I'll back it out later tonight or tomorrow.
Flags: needinfo?(bas)
Comment 18•10 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #17)
> (In reply to Robert Kaiser (:kairo@mozilla.com) from comment #16)
> > (In reply to Bas Schouten (:bas.schouten) from comment #15)
> > > I thought we were backing it out for perf regressions anyway?
> >
> > Doesn't look like anyone has done that. Given that bug 1067311 is the
> > largest stability issue on Nightly atm, can you please make sure some action
> > happens before the weekend?
>
> I'll back it out later tonight or tomorrow.
You still backing this out?
Flags: needinfo?(bas)
Comment 19•10 years ago
|
||
(In reply to Benjamin Kerensa [:bkerensa] from comment #18)
> (In reply to Bas Schouten (:bas.schouten) from comment #17)
> > (In reply to Robert Kaiser (:kairo@mozilla.com) from comment #16)
> > > (In reply to Bas Schouten (:bas.schouten) from comment #15)
> > > > I thought we were backing it out for perf regressions anyway?
> > >
> > > Doesn't look like anyone has done that. Given that bug 1067311 is the
> > > largest stability issue on Nightly atm, can you please make sure some action
> > > happens before the weekend?
> >
> > I'll back it out later tonight or tomorrow.
>
> You still backing this out?
Matt Woodrow is back and working on this.
Flags: needinfo?(bas)
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(matt.woodrow)
You need to log in
before you can comment on or make changes to this bug.
Description
•