Closed Bug 1249936 Opened 10 years ago Closed 10 years ago

Add a LayerComposite::GetShadowTransform() method which returns the shadow base transform multiplied by the scales

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: botond, Assigned: ronoueb, Mentored)

References

Details

(Whiteboard: [lang=c++] [gfx-noted])

Attachments

(2 files, 3 obsolete files)

Now that bug 1247450 has renamed LayerComposite::GetShadowTransform() to GetShadowBaseTransform() to indicate that it does not include the pre- and post-scales, we can add a method LayerComposite::GetShadowTransform() which returns the transform that does include the pre- and post-scales. The implementation of this method would look very similar to the implementation of Layer::GetTransform(), except instead of using Layer::mTransform as the starting point, it would use LayerComposite::mShadowTransform. Having done this, we can also simplify the implementation of Layer::GetLocalTransform() - we can have it return either LayerComposite::GetShadowTransform(), or Layer::GetTransform(), depending on whether the layer is a LayerComposite, and not multiply by the scales itself.
I will take on this bug.
Thanks! I assigned the bug to you. Let me know if you have any questions!
Assignee: nobody → matthewstroud101
One question would be a good IDE? One that is capable of running decently on a Virtual Machine?
(In reply to matthewstroud101 from comment #3) > One question would be a good IDE? One that is capable of running decently on > a Virtual Machine? I'd say it's mostly a matter of taste. I use Eclipse CDT, and I find it works well, including on a virtual machine (although it's a bit of a memory hog, so it depends how much memory the virtual machine has). I know others who use Visual Studio or Xcode, or editors that aren't IDEs like Sublime Text or vim. If you'd like to try Eclipse, our build system has a command that generates an Eclipse project suitable for editing mozilla-central code: ./mach build-backend -b CppEclipse (There is a similar command for creating a Visual Studio project, too.)
Matthew, are you still working on this? If you're stuck on anything, I'm happy to help!
Flags: needinfo?(matthewstroud101)
I became pretty busy with school since I asked to work on this bug. Right now, I feel like I do not have the time to work on it until I graduate in June. I am still interested in working on bug patches for Mozilla, but for now, if somebody else wants to work on this, then they should be able to.
That's no problem. I'll un-assign the bug from you, so others know it's available to be worked on.
Assignee: matthewstroud101 → nobody
Flags: needinfo?(matthewstroud101)
Whiteboard: [lang=c++] → [lang=c++] [gfx-noted]
Attached patch add a GetShadowTransform method (obsolete) — — Splinter Review
Sorry about the "whitespace noise", I guess my editor did that when I saved.
Attachment #8747428 - Flags: feedback?(botond)
Attached patch simplify GetLocalTransform (obsolete) — — Splinter Review
Attachment #8747429 - Flags: feedback?(botond)
Assignee: nobody → bd339
Comment on attachment 8747428 [details] [diff] [review] add a GetShadowTransform method Review of attachment 8747428 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, this looks good! (Normally, I'd ask for the 'const' to be removed from the return type, because I don't see any point in that when returning by value, but I see Layer::GetTransform() has it as well, so let's just remain consistent with that.) The only other thing required to land the patch is a commit message, of the form "Bug <bugnumber> - <description>. r=<reviewer>". Could you upload a new version of the patch that includes that? The reviewer would be me ("botond"). Thanks!
Attachment #8747428 - Flags: feedback?(botond) → feedback+
Comment on attachment 8747429 [details] [diff] [review] simplify GetLocalTransform Review of attachment 8747429 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks! As with the other patch, please add a commit message.
Attachment #8747429 - Flags: feedback?(botond) → feedback+
(In reply to Botond Ballo [:botond] from comment #10) > Comment on attachment 8747428 [details] [diff] [review] > add a GetShadowTransform method > > Review of attachment 8747428 [details] [diff] [review]: > ----------------------------------------------------------------- > > (Normally, I'd ask for the 'const' to be removed from the return type, > because I don't see any point in that when returning by value, but I see > Layer::GetTransform() has it as well, so let's just remain consistent with > that.) > I was confused about the decision to make Layer::GetTransform return a const value as well. The only thing I could think of, is if for some reason you want to prevent the codebase doing something like GetTransform().SomeNonConstFunction(); but even so that is rather pointless as one can just store the return value in a non-const value and then due a non-const operation on it. Of course it makes perfect sense if we were returning by reference like GetShadowBaseTransform.
Attachment #8747428 - Attachment is obsolete: true
Attachment #8747429 - Attachment is obsolete: true
Attachment #8747506 - Flags: review?(botond)
No code changes, just messed up last time in generating the patch in the format expected.
Attachment #8747506 - Attachment is obsolete: true
Attachment #8747506 - Flags: review?(botond)
Forgot to request review from you in BugZilla.
Flags: needinfo?(botond)
Comment on attachment 8747510 [details] [diff] [review] add a GetShadowTransform method & simplify GetLocalTransform, 2nd revision Review of attachment 8747510 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8747510 - Flags: review+
Here's a build-only Try push with the patch applied, to make sure it builds on all platforms: https://treeherder.mozilla.org/#/jobs?repo=try&revision=337e6e49b5ac
Flags: needinfo?(botond)
(In reply to bd339 from comment #12) > (In reply to Botond Ballo [:botond] from comment #10) > > (Normally, I'd ask for the 'const' to be removed from the return type, > > because I don't see any point in that when returning by value, but I see > > Layer::GetTransform() has it as well, so let's just remain consistent with > > that.) > > I was confused about the decision to make Layer::GetTransform return a const > value as well. The only thing I could think of, is if for some reason you > want to prevent the codebase doing something like > GetTransform().SomeNonConstFunction(); but even so that is rather pointless > as one can just store the return value in a non-const value and then due a > non-const operation on it. Of course it makes perfect sense if we were > returning by reference like GetShadowBaseTransform. If you'd like to write a follow-up patch to remove the const from the return types of each of Layer::GetTransform(), Layer::GetLocalTransform(), and LayerComposite::GetShadowTransform(), I would review that.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
(In reply to Botond Ballo [:botond] from comment #18) > If you'd like to write a follow-up patch to remove the const from the return > types of each of Layer::GetTransform(), Layer::GetLocalTransform(), and > LayerComposite::GetShadowTransform(), I would review that. Yes, I would like to do that.
Should such a follow-up patch be submitted against a new bug or this one?
Flags: needinfo?(botond)
(In reply to bd339 from comment #22) > Should such a follow-up patch be submitted against a new bug or this one? Might as well do it in this bug.
Flags: needinfo?(botond)
Attachment #8748171 - Flags: feedback?(botond)
Comment on attachment 8748171 [details] [diff] [review] remove unnecessary const from functions Review of attachment 8748171 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8748171 - Flags: feedback?(botond) → review+
(In reply to Pulsebot from comment #27) > https://hg.mozilla.org/integration/mozilla-inbound/rev/814ea77366d2 ^ Landed the second patch. bd339, thanks for your contributions in this bug! If you're interesting in working on more bugs, and would like some suggestions, let me know.
(In reply to Botond Ballo [:botond] from comment #28) > bd339, thanks for your contributions in this bug! If you're interesting in > working on more bugs, and would like some suggestions, let me know. I am very much interested.
(In reply to bd339 from comment #29) > (In reply to Botond Ballo [:botond] from comment #28) > > bd339, thanks for your contributions in this bug! If you're interesting in > > working on more bugs, and would like some suggestions, let me know. > > I am very much interested. From among the bugs I'm mentoring, bug 1170062 might be a good one for you. Of course, there are also bugs others are mentoring, I'm just not familiar enough with them to recommend specific ones; http://www.joshmatthews.net/bugsahoy/ is a good tool for picking one.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: