author | Chris Pearce <cpearce@mozilla.com> |
Mon, 11 Feb 2013 11:31:00 +1300 | |
changeset 121478 | a4257f41a6edc1eaf62b482c91ebe605dcd9b2d3 |
parent 121477 | 821c4263e71c7b356e0ab48288048923a569b927 |
child 121479 | 1ff7a764c2a9fcaaec2c6b254a86832c1bdf4fca |
push id | 24291 |
push user | ryanvm@gmail.com |
push date | Mon, 11 Feb 2013 19:12:51 +0000 |
treeherder | mozilla-central@93ba23f414ff [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | BenWa |
bugs | 805261 |
milestone | 21.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
widget/cocoa/nsChildView.h | file | annotate | diff | comparison | revisions | |
widget/cocoa/nsChildView.mm | file | annotate | diff | comparison | revisions |
--- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -395,16 +395,17 @@ public: NS_IMETHOD Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint); NS_IMETHOD Enable(bool aState); virtual bool IsEnabled() const; NS_IMETHOD SetFocus(bool aRaise); NS_IMETHOD GetBounds(nsIntRect &aRect); NS_IMETHOD GetClientBounds(nsIntRect &aRect); + NS_IMETHOD GetScreenBounds(nsIntRect &aRect); // Returns the "backing scale factor" of the view's window, which is the // ratio of pixels in the window's backing store to Cocoa points. Prior to // HiDPI support in OS X 10.7, this was always 1.0, but in HiDPI mode it // will be 2.0 (and might potentially other values as screen resolutions // evolve). This gives the relationship between what Gecko calls "device // pixels" and the Cocoa "points" coordinate system. CGFloat BackingScaleFactor();
--- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -791,16 +791,23 @@ NS_IMETHODIMP nsChildView::GetClientBoun // For top level widgets we want the position on screen, not the position // of this view inside the window. MOZ_ASSERT(mWindowType != eWindowType_plugin, "plugin widgets should have parents"); aRect.MoveTo(WidgetToScreenOffset()); } return NS_OK; } +NS_IMETHODIMP nsChildView::GetScreenBounds(nsIntRect &aRect) +{ + GetBounds(aRect); + aRect.MoveTo(WidgetToScreenOffset()); + return NS_OK; +} + double nsChildView::GetDefaultScaleInternal() { return BackingScaleFactor(); } CGFloat nsChildView::BackingScaleFactor()