Closed
Bug 1085529
Opened 11 years ago
Closed 11 years ago
Port nsCSSRendering::PaintDecorationLine() to Moz2D
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(2 files, 2 obsolete files)
|
25.69 KB,
patch
|
mattwoodrow
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
|
1.17 KB,
patch
|
mattwoodrow
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8508115 -
Flags: review?(matt.woodrow)
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8508116 -
Flags: review?(matt.woodrow)
| Assignee | ||
Comment 3•11 years ago
|
||
Calling the local variable "aDrawTarget" is a bit of an abuse of our naming convention, but when we eventually come switch all nsRenderingContext* arguments to DrawTarget args it will make that work a lot easier to write and to review.
Comment 4•11 years ago
|
||
Comment on attachment 8508115 [details] [diff] [review]
part 1 - Add an AutoPopClip helper to Moz2D
Review of attachment 8508115 [details] [diff] [review]:
-----------------------------------------------------------------
Can we make PushClipRect a function on this class, and only PopClip if it gets called? That way you can use this in cases where clipping isn't unconditional.
Comment 5•11 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #3)
> Calling the local variable "aDrawTarget" is a bit of an abuse of our naming
> convention, but when we eventually come switch all nsRenderingContext*
> arguments to DrawTarget args it will make that work a lot easier to write
> and to review.
Where is this? I don't see it!
Comment 6•11 years ago
|
||
Comment on attachment 8508116 [details] [diff] [review]
part 2 - Port nsCSSRendering::PaintDecorationLine() to Moz2D
Review of attachment 8508116 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, assuming you like my suggestion for part 1.
aDrawTarget.PushClipRect(rect);
autoPopClip.EnsureInit(&aDrawTarget);
Would become:
autoRestoreClip.ClipToRect(rect);
or similar.
Attachment #8508116 -
Flags: review?(matt.woodrow) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Matt Woodrow (:mattwoodrow) from comment #4)
> Can we make PushClipRect a function on this class, and only PopClip if it
> gets called? That way you can use this in cases where clipping isn't
> unconditional.
The combination of the default ctor and the EnsureEnit() function was intended to address this case. However, this class doesn't really meet the needs I'm seeing in later Moz2D patches I've started work on. Specifically I more want to be able to push multiple clips and have them all auto pop'ed.
| Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8508495 -
Flags: review?(matt.woodrow)
| Assignee | ||
Updated•11 years ago
|
Attachment #8508115 -
Attachment is obsolete: true
Attachment #8508115 -
Flags: review?(matt.woodrow)
| Assignee | ||
Comment 9•11 years ago
|
||
The one thing I don't like about this is that it kinda hides a little that the clip is being applied to the DrawTarget. I think I might rename it to AutoDrawTargetClipper and call instances autoDrawTargetClipper. Then at least "DrawTarget" is in the name and the code reads:
autoDrawTargetClipper.PushClip(path);
autoDrawTargetClipper.PushClipRect(rect);
which makes what's going on a bit clearer.
| Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Matt Woodrow (:mattwoodrow) from comment #5)
> Where is this? I don't see it!
Sorry, that comment belonged on bug 1085533.
Comment 11•11 years ago
|
||
Comment on attachment 8508495 [details] [diff] [review]
part 1 - Add an AutoPushPopClips helper to Moz2D
Review of attachment 8508495 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/2d/Helpers.h
@@ +44,5 @@
> RefPtr<DrawTarget> mDrawTarget;
> Matrix mOldTransform;
> };
>
> +class AutoPushPopClips
I'd prefer just AutoPopClips, or AutoRestoreClips. We're not really doing any sort of 'auto' pushing. It also matches the convention (AutoRestoreTransform) better.
Attachment #8508495 -
Flags: review?(matt.woodrow) → review+
| Assignee | ||
Comment 12•11 years ago
|
||
See comment 9. I'm using AutoDrawTargetClipper now.
If we're going to call this AutoPopClips then I want to implement it differently. I'd rather add a GetClipStackLength() method to DrawTarget and in the AutoPopClips ctor record the current length. In the dtor we'd then pop clips until we're back to that recorded length. In fact I like this behavior since it allows us to continue to call PushClip/PushClipRect on the DT which makes the code clearer.
| Assignee | ||
Comment 14•11 years ago
|
||
Although maybe GetClipCount would be a better name?
Comment 15•11 years ago
|
||
Comment on attachment 8508619 [details] [diff] [review]
part 1 - Add an AutoPopClips helper to Moz2D
Review of attachment 8508619 [details] [diff] [review]:
-----------------------------------------------------------------
This is indeed nicer and safer. I'm going to have to defer to Bas for Moz2D API changes though.
Implementation looks good though, so if you can get an informal r+ on the API change then I can r+ the rest.
Attachment #8508619 -
Flags: review?(matt.woodrow) → review?(bas)
| Assignee | ||
Comment 16•11 years ago
|
||
Comment on attachment 8508619 [details] [diff] [review]
part 1 - Add an AutoPopClips helper to Moz2D
Bas preferred the other r+'ed RAII patch.
Attachment #8508619 -
Attachment is obsolete: true
Attachment #8508619 -
Flags: review?(bas)
| Assignee | ||
Comment 17•11 years ago
|
||
Comment on attachment 8508495 [details] [diff] [review]
part 1 - Add an AutoPushPopClips helper to Moz2D
https://hg.mozilla.org/integration/mozilla-inbound/rev/3fa71a8dc29c
Attachment #8508495 -
Flags: checkin+
| Assignee | ||
Comment 18•11 years ago
|
||
Comment on attachment 8508116 [details] [diff] [review]
part 2 - Port nsCSSRendering::PaintDecorationLine() to Moz2D
https://hg.mozilla.org/integration/mozilla-inbound/rev/758840ac2f47
Attachment #8508116 -
Flags: checkin+
Comment 19•11 years ago
|
||
Both backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/99191005ec67 for...
| Comment hidden (Legacy TBPL/Treeherder Robot) |
| Assignee | ||
Comment 21•11 years ago
|
||
Now that I've fixed bug 1087224 I re-pushed, this time with fuzzing for the failing test on Windows 8:
https://hg.mozilla.org/integration/mozilla-inbound/rev/79b64654f809
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a8948248cbd
Comment 22•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/79b64654f809
https://hg.mozilla.org/mozilla-central/rev/7a8948248cbd
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•