Closed Bug 875335 Opened 12 years ago Closed 11 years ago

Finish OMTC titlebar drawing

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(2 files, 3 obsolete files)

This bug deals with the remaining OMTC work from bug 676241.
The new patch in bug 873944 apparently doesn't trigger a composition during drawRect when none has been scheduled from Gecko. So it won't fix the bug which I'd hoped it would fix, namely that hovering the titlebar buttons in OMTC drawintitlebar mode currently doesn't repaint them in their hovered state.
This is quite the brute force approach and looks very hacky. Any better ideas? The ClientLayerManager.cpp hunk makes us call PrepareWindowEffects in the empty transaction case, too, not only in the normal transaction case. I think we want this anyway. The nsViewManager.cpp hunk makes us call BeginTransaction+EndEmptyTransaction from viewWillDraw even if no views have ForcedRepaint(). The rest causes ShadowLayerForwarder to trigger a recomposition during viewWillDraw even though the transaction mTxn is empty.
Attachment #759734 - Flags: feedback?(matt.woodrow)
Comment on attachment 759732 [details] [diff] [review] part 1: call NotifyDirtyRegion during viewWillDraw I think this patch would be good to take anyway, regardless of the validity of the next patch.
Attachment #759732 - Flags: review?(matt.woodrow)
Attachment #759732 - Flags: review?(matt.woodrow) → review+
Comment on attachment 759734 [details] [diff] [review] part 2: trigger recomposition from viewWillDraw even if no layers changed Review of attachment 759734 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsPresShell.cpp @@ +5520,5 @@ > // that will cause us to forget to update the real layer manager! > if (!(aFlags & PAINT_LAYERS)) { > + if (layerManager->HasShadowManager() && Compositor::GetBackend() != LAYERS_BASIC) { > + return; > + } I assume this indention change wasn't intentional? ::: view/src/nsViewManager.cpp @@ +634,5 @@ > } > + } else { > + LayerManager *manager = aWidget->GetLayerManager(); > + if (manager->HasShadowManager() && > + Compositor::GetBackend() != LAYERS_BASIC) { How about just taking the normal branch if this check is true? Either move it up, or put it inside ForcedRepaint(). If we have OMTC, then getting a paint event means we always want to force a repaint. If we ever get OMTC everywhere, then we could drop the forced repaint concept entirely. I'd feel better about that rather than having explicit Begin/EndTransaction calls inside view code.
Attachment #759734 - Flags: feedback?(matt.woodrow) → feedback+
Attached patch part 1 (deleted) — Splinter Review
Attachment #759732 - Attachment is obsolete: true
Attached patch part 2 (obsolete) (deleted) — Splinter Review
(In reply to Matt Woodrow (:mattwoodrow) from comment #5) > Comment on attachment 759734 [details] [diff] [review] > part 2: trigger recomposition from viewWillDraw even if no layers changed > > Review of attachment 759734 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: layout/base/nsPresShell.cpp > @@ +5520,5 @@ > > // that will cause us to forget to update the real layer manager! > > if (!(aFlags & PAINT_LAYERS)) { > > + if (layerManager->HasShadowManager() && Compositor::GetBackend() != LAYERS_BASIC) { > > + return; > > + } > > I assume this indention change wasn't intentional? Huh, not sure how this happened. > ::: view/src/nsViewManager.cpp > @@ +634,5 @@ > > } > > + } else { > > + LayerManager *manager = aWidget->GetLayerManager(); > > + if (manager->HasShadowManager() && > > + Compositor::GetBackend() != LAYERS_BASIC) { > > How about just taking the normal branch if this check is true? > > Either move it up, or put it inside ForcedRepaint(). I've moved it up.
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Attachment #761925 - Flags: review?(matt.woodrow)
Attachment #759734 - Attachment is obsolete: true
Comment on attachment 761925 [details] [diff] [review] part 2 Review of attachment 761925 [details] [diff] [review]: ----------------------------------------------------------------- ::: view/src/nsViewManager.cpp @@ +632,5 @@ > + LayerManager *manager = aWidget->GetLayerManager(); > + if (view && > + (view->ForcedRepaint() || > + (manager->HasShadowManager() && > + Compositor::GetBackend() != LAYERS_BASIC))) { I'm assuming this will land after bug 873944? In which case these two lines can just become !manager->NeedsWidgetInvalidation()
Attachment #761925 - Flags: review?(matt.woodrow) → review+
Attached patch part2 (deleted) — Splinter Review
Yes, I'll wait for bug 873944 before landing this.
Attachment #761925 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Depends on: 888458
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: