Closed Bug 1370757 Opened 7 years ago Closed 7 years ago

Avoid inflating the dirty rect in nsNativeThemeCocoa::DrawWidgetBackground

Categories

(Core :: Widget: Cocoa, enhancement, P2)

All
macOS
enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mstange, Assigned: mstange)

Details

(Whiteboard: tpi:+)

Attachments

(3 files, 2 obsolete files)

      No description provided.
Attachment #8875099 - Attachment is obsolete: true
Attachment #8875100 - Attachment is obsolete: true
Priority: -- → P2
Whiteboard: tpi:+
Comment on attachment 8875504 [details]
Bug 1370757 - Improve widget overflow calculation.

https://reviewboard.mozilla.org/r/146936/#review151014

::: widget/cocoa/nsNativeThemeCocoa.mm:3179
(Diff revision 1)
> +    // Double the number of device pixels.
> +    overflow += overflow;
> -    }
> +  }
> +
> +  if (overflow != nsIntMargin()) {
> +    int32_t p2a = aFrame->PresContext()->AppUnitsPerDevPixel();

I've thought about this before, are you sure this conversion is supposed to be using dev pixels?

That seems like it would make the overflow areas half the physical size when we're in HiDPI mode.

Are these constant overflows not in logical pixels instead?
Attachment #8875504 - Flags: review?(matt.woodrow) → review+
Comment on attachment 8875098 [details]
Bug 1370757 - Don't expand the dirty rect for Mac native widget drawing.

https://reviewboard.mozilla.org/r/146482/#review151020
Attachment #8875098 - Flags: review?(matt.woodrow) → review+
(In reply to Matt Woodrow (:mattwoodrow) from comment #8)
> Comment on attachment 8875504 [details]
> Bug 1370757 - Improve widget overflow calculation.
> 
> https://reviewboard.mozilla.org/r/146936/#review151014
> 
> ::: widget/cocoa/nsNativeThemeCocoa.mm:3179
> (Diff revision 1)
> > +    // Double the number of device pixels.
> > +    overflow += overflow;
> > -    }
> > +  }
> > +
> > +  if (overflow != nsIntMargin()) {
> > +    int32_t p2a = aFrame->PresContext()->AppUnitsPerDevPixel();
> 
> I've thought about this before, are you sure this conversion is supposed to
> be using dev pixels?

Yes, I'm sure. If you full-zoom a website, native widgets become larger but they don't become scaled. We only scale (by a factor of exactly 2) when IsHiDPIContext returns true.
That's why GetWidgetOverflow also calls IsHiDPIContext now.

DrawCellWithScaling/Snapping are special; but there we choose to respond to a larger area by applying a scale.
Comment on attachment 8875503 [details]
Bug 1370757 - Only push device aligned clips.

https://reviewboard.mozilla.org/r/146934/#review151050
Attachment #8875503 - Flags: review?(lsalzman) → review+
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s a9f3bcdafeb5 -d 757a3c336d6e: rebasing 400716:a9f3bcdafeb5 "Bug 1370757 - Only push device aligned clips. r=lsalzman"
rebasing 400717:bcfd15c22258 "Bug 1370757 - Improve widget overflow calculation. r=mattwoodrow"
rebasing 400718:3214e698830f "Bug 1370757 - Don't expand the dirty rect for Mac native widget drawing. r=mattwoodrow" (tip)
merging layout/reftests/css-ui-invalid/default-style/reftest.list
warning: conflicts while merging layout/reftests/css-ui-invalid/default-style/reftest.list! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s 9cb8ff414128 -d b63a5b39d75a: rebasing 400877:9cb8ff414128 "Bug 1370757 - Only push device aligned clips. r=lsalzman"
rebasing 400878:0dab9cfab024 "Bug 1370757 - Improve widget overflow calculation. r=mattwoodrow"
rebasing 400879:8402cfb71e92 "Bug 1370757 - Don't expand the dirty rect for Mac native widget drawing. r=mattwoodrow" (tip)
merging layout/reftests/css-ui-invalid/default-style/reftest.list
warning: conflicts while merging layout/reftests/css-ui-invalid/default-style/reftest.list! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/9db3efe6c035
Only push device aligned clips. r=lsalzman
https://hg.mozilla.org/integration/autoland/rev/34bb128e167e
Improve widget overflow calculation. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/7642d6435b63
Don't expand the dirty rect for Mac native widget drawing. r=mattwoodrow
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: