Closed
Bug 923341
Opened 11 years ago
Closed 11 years ago
Update imagelib surface caching code to avoid creating unnecessary Thebes contexts
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: seth, Assigned: mattwoodrow)
References
(Depends on 1 open bug)
Details
(Whiteboard: [qa-])
Attachments
(4 files)
4.78 KB,
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
3.92 KB,
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
2.83 KB,
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
1.19 KB,
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
Once we have gfxDrawTargetDrawable we can remove the unnecessary GetThebesSurfaceForDrawTarget() call in VectorImage::CreateDrawableAndShow.
Reporter | ||
Comment 1•11 years ago
|
||
We should also update CachedSurface::Drawable. Any code that uses SurfaceCache should get a lookover once gfxDrawTargetDrawable is available.
Summary: Update VectorImage::CreateDrawableAndShow to avoid creating unnecessary Thebes contexts → Update imagelib surface caching code to avoid creating unnecessary Thebes contexts
Reporter | ||
Comment 2•11 years ago
|
||
At the moment it looks like this will be solved by adding features to Moz2D (source clipping for patterns) to support the missing use cases we need, and then not calling DrawPixelSnapped at all on Moz2D platforms. This will get hammered out in more detail at the upcoming web rendering work week.
Assignee | ||
Comment 3•11 years ago
|
||
This adds a dreaded call to GetThebesSurfaceForDrawTarget, but only to use as a source. This should work everywhere, though may involve readback.
There's no other way to avoid this other than just never having a gfxContext that returns true for IsCairo() (which we're working on!).
Attachment #831283 -
Flags: review?(seth)
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #831284 -
Flags: review?(seth)
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #831285 -
Flags: review?(seth)
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Assignee: seth → matt.woodrow
Reporter | ||
Updated•11 years ago
|
Attachment #831283 -
Flags: review?(seth) → review+
Reporter | ||
Comment 7•11 years ago
|
||
Comment on attachment 831284 [details] [diff] [review]
Part 2: Use SVG caches on all azure backends.
Review of attachment 831284 [details] [diff] [review]:
-----------------------------------------------------------------
So glad that ugly code is gone!
::: image/src/VectorImage.cpp
@@ +836,5 @@
> // If we couldn't create the draw target, it was probably because it would end
> // up way too big. Generally it also wouldn't fit in the cache, but the prefs
> // could be set such that the cache isn't the limiting factor. If we couldn't
> // create the surface, we are on a platform that does not support
> // GetThebesSurfaceForDrawTarget. This will be fixed in bug 923341.
Should probably update this comment since |surface| is gone now. (Can just remove the last two sentences, I think.)
Is there another reason CreateOffscreenContentDrawTarget could fail?
@@ +842,2 @@
> return Show(svgDrawable, aParams);
> +
Nit: Stray whitespace.
Attachment #831284 -
Flags: review?(seth) → review+
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 831285 [details] [diff] [review]
Part 3: Use azure for CreateSamplingRestrictedDrawable
Review of attachment 831285 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxUtils.cpp
@@ +271,5 @@
> + if (target) {
> + drawable = new gfxSurfaceDrawable(target, size, gfxMatrix().Translate(-needed.TopLeft()));
> + } else {
> + drawable = new gfxSurfaceDrawable(temp, size, gfxMatrix().Translate(-needed.TopLeft()));
> + }
Maybe just fold this into the previous if/else pair?
Attachment #831285 -
Flags: review?(seth) → review+
Assignee | ||
Comment 9•11 years ago
|
||
Missed this the first time.
Attachment #831812 -
Flags: review?(seth)
Reporter | ||
Comment 10•11 years ago
|
||
Comment on attachment 831812 [details] [diff] [review]
Part 4: Update CachedSurface::Drawable
Review of attachment 831812 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
Attachment #831812 -
Flags: review?(seth) → review+
Assignee | ||
Comment 11•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/faef54ec06cd
https://hg.mozilla.org/mozilla-central/rev/79cfed9c9d1d
https://hg.mozilla.org/mozilla-central/rev/810c38bc0493
https://hg.mozilla.org/mozilla-central/rev/99108bac6f2d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•