mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 14:30:43 +00:00
Bug 1224403 (part 1) - Make Configuration::mBounds a LayoutDeviceIntRect. r=kats.
--HG-- extra : rebase_source : a0ae2779dfd9bc10730c8b38bc082453845daa1f
This commit is contained in:
parent
68f3cf2767
commit
ff5231e6d2
@ -513,7 +513,7 @@ ShadowLayerForwarder::StorePluginWidgetConfigurations(const nsTArray<nsIWidget::
|
||||
const nsIWidget::Configuration& configuration = aConfigurations[idx];
|
||||
mPluginWindowData.AppendElement(PluginWindowData(configuration.mWindowID,
|
||||
configuration.mClipRegion,
|
||||
configuration.mBounds,
|
||||
configuration.mBounds.ToUnknownRect(),
|
||||
configuration.mVisible));
|
||||
}
|
||||
}
|
||||
|
@ -3132,7 +3132,7 @@ SortConfigurations(nsTArray<nsIWidget::Configuration>* aConfigurations)
|
||||
nsAutoTArray<nsIntRect,1> clipRects;
|
||||
pluginsToMove[j].mChild->GetWindowClipRegion(&clipRects);
|
||||
if (HasOverlap(bounds.TopLeft(), clipRects,
|
||||
config->mBounds.TopLeft(),
|
||||
config->mBounds.ToUnknownRect().TopLeft(),
|
||||
config->mClipRegion)) {
|
||||
foundOverlap = true;
|
||||
break;
|
||||
|
@ -408,7 +408,8 @@ nsPluginFrame::GetWidgetConfiguration(nsTArray<nsIWidget::Configuration>* aConfi
|
||||
|
||||
nsIWidget::Configuration* configuration = aConfigurations->AppendElement();
|
||||
configuration->mChild = mWidget;
|
||||
configuration->mBounds = mNextConfigurationBounds;
|
||||
configuration->mBounds =
|
||||
LayoutDeviceIntRect::FromUnknownRect(mNextConfigurationBounds);
|
||||
configuration->mClipRegion = mNextConfigurationClipRegion;
|
||||
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
|
||||
if (XRE_IsContentProcess()) {
|
||||
|
@ -240,8 +240,8 @@ PuppetWidget::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
|
||||
NS_ASSERTION(w->GetParent() == this,
|
||||
"Configured widget is not a child");
|
||||
w->SetWindowClipRegion(configuration.mClipRegion, true);
|
||||
nsIntRect bounds;
|
||||
w->GetBoundsUntyped(bounds);
|
||||
LayoutDeviceIntRect bounds;
|
||||
w->GetBounds(bounds);
|
||||
if (bounds.Size() != configuration.mBounds.Size()) {
|
||||
w->Resize(configuration.mBounds.x, configuration.mBounds.y,
|
||||
configuration.mBounds.width, configuration.mBounds.height,
|
||||
|
@ -4300,14 +4300,16 @@ nsWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
|
||||
nsWindow* w = static_cast<nsWindow*>(configuration.mChild.get());
|
||||
NS_ASSERTION(w->GetParent() == this,
|
||||
"Configured widget is not a child");
|
||||
LayoutDeviceIntRect wBounds =
|
||||
LayoutDeviceIntRect::FromUnknownRect(w->mBounds);
|
||||
w->SetWindowClipRegion(configuration.mClipRegion, true);
|
||||
if (w->mBounds.Size() != configuration.mBounds.Size()) {
|
||||
if (wBounds.Size() != configuration.mBounds.Size()) {
|
||||
w->Resize(configuration.mBounds.x, configuration.mBounds.y,
|
||||
configuration.mBounds.width, configuration.mBounds.height,
|
||||
true);
|
||||
} else if (w->mBounds.TopLeft() != configuration.mBounds.TopLeft()) {
|
||||
} else if (wBounds.TopLeft() != configuration.mBounds.TopLeft()) {
|
||||
w->Move(configuration.mBounds.x, configuration.mBounds.y);
|
||||
}
|
||||
}
|
||||
w->SetWindowClipRegion(configuration.mClipRegion, false);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1008,7 +1008,7 @@ class nsIWidget : public nsISupports {
|
||||
nsCOMPtr<nsIWidget> mChild;
|
||||
uintptr_t mWindowID; // e10s specific, the unique plugin port id
|
||||
bool mVisible; // e10s specific, widget visibility
|
||||
nsIntRect mBounds;
|
||||
mozilla::LayoutDeviceIntRect mBounds;
|
||||
nsTArray<nsIntRect> mClipRegion;
|
||||
};
|
||||
|
||||
|
@ -601,11 +601,13 @@ nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& aConfigura
|
||||
NS_ASSERTION(w->GetParent() == this,
|
||||
"Configured widget is not a child");
|
||||
|
||||
if (w->mBounds.Size() != configuration.mBounds.Size()) {
|
||||
LayoutDeviceIntRect wBounds =
|
||||
LayoutDeviceIntRect::FromUnknownRect(w->mBounds);
|
||||
if (wBounds.Size() != configuration.mBounds.Size()) {
|
||||
w->Resize(configuration.mBounds.x, configuration.mBounds.y,
|
||||
configuration.mBounds.width, configuration.mBounds.height,
|
||||
true);
|
||||
} else if (w->mBounds.TopLeft() != configuration.mBounds.TopLeft()) {
|
||||
} else if (wBounds.TopLeft() != configuration.mBounds.TopLeft()) {
|
||||
w->Move(configuration.mBounds.x, configuration.mBounds.y);
|
||||
}
|
||||
}
|
||||
|
@ -6530,8 +6530,8 @@ nsWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
|
||||
"Configured widget is not a child");
|
||||
nsresult rv = w->SetWindowClipRegion(configuration.mClipRegion, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsIntRect bounds;
|
||||
w->GetBoundsUntyped(bounds);
|
||||
LayoutDeviceIntRect bounds;
|
||||
w->GetBounds(bounds);
|
||||
if (bounds.Size() != configuration.mBounds.Size()) {
|
||||
w->Resize(configuration.mBounds.x, configuration.mBounds.y,
|
||||
configuration.mBounds.width, configuration.mBounds.height,
|
||||
@ -6547,7 +6547,7 @@ nsWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
|
||||
// plugin window that might be touched by moving content somehow. The
|
||||
// underlying problem should be found and fixed!
|
||||
nsIntRegion r;
|
||||
r.Sub(bounds, configuration.mBounds);
|
||||
r.Sub(bounds.ToUnknownRect(), configuration.mBounds.ToUnknownRect());
|
||||
r.MoveBy(-bounds.x,
|
||||
-bounds.y);
|
||||
nsIntRect toInvalidate = r.GetBounds();
|
||||
|
Loading…
x
Reference in New Issue
Block a user