Closed Bug 988309 Opened 6 years ago Closed 6 years ago
Add a ns
Rendering Context ctor that takes a Moz2D Draw Target
As part of the conversion to Moz2D we really need an nsRenderingContext ctor that takes a Moz2D DrawTarget. For example, when converting the code that creates a gfxPattern for an SVG mask to work on a temporary DrawTarget we need to wrap that DrawTarget in an nsRenderingContext in order to pass it to the SVG drawing code that draws the mask content. There would be one major issue with such an nsRenderingContext, and that would be what to do for nsRenderingContext::ThebesContext(). We need any changes made to the gfxContext to be reflected onto the DrawTarget, and we need the initial state of the gfxContext to reflect the current state of the DrawTarget. For that we need the gfxContext to wrap the DrawTarget, and we need to initially set the gfxContext's transform and clip stack to be the same as the DrawTarget's. gfxContext::ContextForDrawTarget() currently does the former and sets the transform, but it does nothing with the clip stack. In fact Moz2D doesn't even provide a way to access information about the clip stack of a DrawTarget. Alternatively we could convert all of the callers of nsRenderingContext::ThebesContext() to check for and handle a DrawTarget first, but there are a lot of them, and likely we get into the same issue unless we convert all of them in one big bang commit.
Sorry, stealing this since I need it to fix bug 991767.
Assignee: jwatt → matt.woodrow
Attachment #8402420 - Flags: review?(roc)
Attachment #8402420 - Flags: review?(roc) → review+
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Anything QA needs to do here in terms of testing?
Nope, verifying bug 991767 should be sufficient.
(In reply to Matt Woodrow (:mattwoodrow) from comment #4) > Nope, verifying bug 991767 should be sufficient. Okay thanks, I'll flag this as such.
Comment on attachment 8402420 [details] [diff] [review] Add new nsRenderingContext ctor [Approval Request Comment] Bug caused by (feature/regressing bug #): Not a regression, but a prereq for bug 991767 User impact if declined: Can't uplift 991767 Testing completed (on m-c, etc.): Been on m-c for a week or so. Risk to taking this patch (and alternatives if risky): Essentially zero risk, entirely unused code without bug 991767. String or IDL/UUID changes made by this patch: None
(In reply to Matt Woodrow (:mattwoodrow) from comment #4) > Nope, verifying bug 991767 should be sufficient. Verified fixed FF 31
Also verified FF 29, 30 in bug 991767.
You need to log in before you can comment on or make changes to this bug.