Bug 1095754 - Now that the compositor handles plugin geometry updates, remove various main thread apis from PluginWidgetProxy. r=aklotz

This commit is contained in:
Jim Mathies 2015-01-29 13:41:55 -06:00
Родитель f53c479605
Коммит eb58cbcea5
2 изменённых файлов: 6 добавлений и 74 удалений

Просмотреть файл

@ -66,8 +66,6 @@ PluginWidgetProxy::Create(nsIWidget* aParent,
mEnabled = true;
mVisible = true;
mActor->SendResize(mBounds);
return NS_OK;
}
@ -99,7 +97,6 @@ PluginWidgetProxy::Destroy()
PWLOG("PluginWidgetProxy::Destroy()\n");
if (mActor) {
mActor->SendShow(false);
mActor->SendDestroy();
mActor->mWidget = nullptr;
mActor->Send__delete__(mActor);
@ -109,21 +106,12 @@ PluginWidgetProxy::Destroy()
return PuppetWidget::Destroy();
}
NS_IMETHODIMP
PluginWidgetProxy::Show(bool aState)
void
PluginWidgetProxy::GetWindowClipRegion(nsTArray<nsIntRect>* aRects)
{
ENSURE_CHANNEL;
mActor->SendShow(aState);
mVisible = aState;
return NS_OK;
}
NS_IMETHODIMP
PluginWidgetProxy::Invalidate(const nsIntRect& aRect)
{
ENSURE_CHANNEL;
mActor->SendInvalidate(aRect);
return NS_OK;
if (mClipRects && mClipRectCount) {
aRects->AppendElements(mClipRects.get(), mClipRectCount);
}
}
void*
@ -147,43 +135,6 @@ PluginWidgetProxy::GetNativeData(uint32_t aDataType)
return (void*)value;
}
NS_IMETHODIMP
PluginWidgetProxy::Resize(double aWidth, double aHeight, bool aRepaint)
{
ENSURE_CHANNEL;
PWLOG("PluginWidgetProxy::Resize(%0.2f, %0.2f, %d)\n", aWidth, aHeight, aRepaint);
nsIntRect oldBounds = mBounds;
mBounds.SizeTo(nsIntSize(NSToIntRound(aWidth), NSToIntRound(aHeight)));
mActor->SendResize(mBounds);
if (!oldBounds.IsEqualEdges(mBounds) && mAttachedWidgetListener) {
mAttachedWidgetListener->WindowResized(this, mBounds.width, mBounds.height);
}
return NS_OK;
}
NS_IMETHODIMP
PluginWidgetProxy::Resize(double aX, double aY, double aWidth,
double aHeight, bool aRepaint)
{
nsresult rv = Move(aX, aY);
if (NS_FAILED(rv)) {
return rv;
}
return Resize(aWidth, aHeight, aRepaint);
}
NS_IMETHODIMP
PluginWidgetProxy::Move(double aX, double aY)
{
ENSURE_CHANNEL;
PWLOG("PluginWidgetProxy::Move(%0.2f, %0.2f)\n", aX, aY);
mActor->SendMove(aX, aY);
if (mAttachedWidgetListener) {
mAttachedWidgetListener->WindowMoved(this, aX, aY);
}
return NS_OK;
}
NS_IMETHODIMP
PluginWidgetProxy::SetFocus(bool aRaise)
{
@ -193,15 +144,5 @@ PluginWidgetProxy::SetFocus(bool aRaise)
return NS_OK;
}
nsresult
PluginWidgetProxy::SetWindowClipRegion(const nsTArray<nsIntRect>& aRects,
bool aIntersectWithExisting)
{
ENSURE_CHANNEL;
mActor->SendSetWindowClipRegion(aRects, aIntersectWithExisting);
nsBaseWidget::SetWindowClipRegion(aRects, aIntersectWithExisting);
return NS_OK;
}
} // namespace widget
} // namespace mozilla

Просмотреть файл

@ -38,23 +38,14 @@ public:
const nsIntRect& aRect, nsDeviceContext* aContext,
nsWidgetInitData* aInitData = nullptr) MOZ_OVERRIDE;
NS_IMETHOD Destroy() MOZ_OVERRIDE;
NS_IMETHOD Show(bool aState) MOZ_OVERRIDE;
NS_IMETHOD Invalidate(const nsIntRect& aRect) MOZ_OVERRIDE;
NS_IMETHOD Resize(double aWidth, double aHeight, bool aRepaint) MOZ_OVERRIDE;
NS_IMETHOD Resize(double aX, double aY, double aWidth,
double aHeight, bool aRepaint) MOZ_OVERRIDE;
NS_IMETHOD Move(double aX, double aY) MOZ_OVERRIDE;
NS_IMETHOD SetFocus(bool aRaise = false) MOZ_OVERRIDE;
NS_IMETHOD SetParent(nsIWidget* aNewParent) MOZ_OVERRIDE;
virtual nsIWidget* GetParent(void) MOZ_OVERRIDE;
virtual void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE;
virtual nsresult SetWindowClipRegion(const nsTArray<nsIntRect>& aRects,
bool aIntersectWithExisting) MOZ_OVERRIDE;
// nsBaseWidget
virtual nsTransparencyMode GetTransparencyMode() MOZ_OVERRIDE
{ return eTransparencyOpaque; }
virtual void GetWindowClipRegion(nsTArray<nsIntRect>* aRects) MOZ_OVERRIDE;
public:
/**