Closed
Bug 826817
Opened 13 years ago
Closed 13 years ago
Make all platforms always fire WillPaintWindow/DidPaintWindow
Categories
(Core :: Widget, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: roc, Assigned: roc)
References
Details
Attachments
(6 files)
10.91 KB,
patch
|
tnikkel
:
review-
|
Details | Diff | Splinter Review |
Part 2: Remove will-send-did-paint and did-send-will-paint flags from nsIWidgetListener::PaintWindow
15.27 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
14.59 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
8.46 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
9.75 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
2.56 KB,
patch
|
Details | Diff | Splinter Review |
This will simplify some code.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee: nobody → roc
Attachment #698131 -
Flags: review?(tnikkel)
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #698132 -
Flags: review?(tnikkel)
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #698133 -
Flags: review?(tnikkel)
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #698134 -
Flags: review?(tnikkel)
Comment 5•13 years ago
|
||
Comment on attachment 698131 [details] [diff] [review]
Part 1: Send WillPaintWindow/DidPaintWindow from all widget implementations
>diff --git a/widget/xpwidgets/PuppetWidget.cpp b/widget/xpwidgets/PuppetWidget.cpp
> if (mozilla::layers::LAYERS_D3D10 == mLayerManager->GetBackendType()) {
>- mAttachedWidgetListener->PaintWindow(this, region, nsIWidgetListener::WILL_SEND_DID_PAINT);
>+ mAttachedWidgetListener->PaintWindow(this, region,
>+ nsIWidgetListener::SENT_WILL_PAINT | nsIWidgetListener::WILL_SEND_DID_PAINT);
> } else {
> nsRefPtr<gfxContext> ctx = new gfxContext(mSurface);
> ctx->Rectangle(gfxRect(0,0,0,0));
> ctx->Clip();
> AutoLayerManagerSetup setupLayerManager(this, ctx,
> BUFFER_NONE);
>- mAttachedWidgetListener->PaintWindow(this, region, nsIWidgetListener::WILL_SEND_DID_PAINT);
>+ mAttachedWidgetListener->PaintWindow(this, region,
>+ nsIWidgetListener::SENT_WILL_PAINT | nsIWidgetListener::WILL_SEND_DID_PAINT);
> mTabChild->NotifyPainted();
> }
> }
>
>- if (mAttachedWidgetListener) {
>- mAttachedWidgetListener->DidPaintWindow();
>- }
>+ mAttachedWidgetListener->DidPaintWindow();
I think you should keep the null check on mAttachedWidgetListener before DidPaintWindow and also have null checks before PaintWindow.
Attachment #698131 -
Flags: review?(tnikkel) → review+
Updated•13 years ago
|
Attachment #698132 -
Flags: review?(tnikkel) → review+
Updated•13 years ago
|
Attachment #698133 -
Flags: review?(tnikkel) → review+
Updated•13 years ago
|
Attachment #698134 -
Flags: review?(tnikkel) → review+
Comment 6•13 years ago
|
||
Comment on attachment 698131 [details] [diff] [review]
Part 1: Send WillPaintWindow/DidPaintWindow from all widget implementations
>diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
>-bool nsChildView::PaintWindow(nsIntRegion aRegion, bool aIsAlternate)
>-{
>- nsIWidget* widget = this;
>+nsIWidgetListener* nsChildView::GetPaintListener() {
> nsIWidgetListener* listener = mWidgetListener;
>
> // If there is no listener, use the parent popup's listener if that exists.
> if (!listener && mParentWidget) {
> nsWindowType type;
> mParentWidget->GetWindowType(type);
> if (type == eWindowType_popup) {
> widget = mParentWidget;
> listener = mParentWidget->GetWidgetListener();
> }
> }
>
>+ return listener;
>+}
>+
>+bool nsChildView::PaintWindow(nsIntRegion aRegion, bool aIsAlternate)
>+{
>+ nsIWidget* widget = this;
>+ nsIWidgetListener* listener = GetPaintListener();
> if (!listener)
> return false;
>
> bool returnValue = false;
> bool oldDispatchPaint = mIsDispatchPaint;
> mIsDispatchPaint = true;
>- uint32_t flags = nsIWidgetListener::SENT_WILL_PAINT;
>+ uint32_t flags =
>+ nsIWidgetListener::SENT_WILL_PAINT | nsIWidgetListener::WILL_SEND_DID_PAINT;
> if (aIsAlternate) {
> flags |= nsIWidgetListener::PAINT_IS_ALTERNATE;
> }
> returnValue = listener->PaintWindow(widget, aRegion, flags);
>+
>+ listener = GetPaintListener();
>+ if (listener) {
>+ listener->DidPaintWindow();
>+ }
>+
> mIsDispatchPaint = oldDispatchPaint;
> return returnValue;
> }
The old code would change widget from this to mParentWidget when it changed the listener to the parent listener to, so I think this might be wrong actually.
Attachment #698131 -
Flags: review+ → review-
Comment 7•13 years ago
|
||
I rebased these and applied the review comments. Were there any significant changes to the patches in your queue that I might be missing?
Comment 8•13 years ago
|
||
Attachment #706923 -
Flags: review?(roc)
Comment 9•13 years ago
|
||
This is the only significant change.
Assignee | ||
Comment 10•13 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #7)
> I rebased these and applied the review comments. Were there any significant
> changes to the patches in your queue that I might be missing?
No, I haven't done anything with them.
Assignee | ||
Comment 11•13 years ago
|
||
Comment on attachment 706923 [details] [diff] [review]
new Part 1
Review of attachment 706923 [details] [diff] [review]:
-----------------------------------------------------------------
Feel free to land these patches
Attachment #706923 -
Flags: review?(roc) → review+
Comment 12•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #11)
> Feel free to land these patches
That was my plan.
Comment 13•13 years ago
|
||
Comment 14•13 years ago
|
||
Comment 15•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/954ef23857ba
https://hg.mozilla.org/mozilla-central/rev/dbd2536c95b3
https://hg.mozilla.org/mozilla-central/rev/198516229e54
https://hg.mozilla.org/mozilla-central/rev/f4b4392eb8a1
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•