Bug 1229237 (part 2) - Make nsIWidget::DrawWindowUnderlay() take a LayoutDeviceIntRect. r=botond.

--HG--
extra : rebase_source : 0563312f21ea9bf88399377f977c6b21c60a07b6
This commit is contained in:
Nicholas Nethercote 2015-11-16 20:34:00 -08:00
parent 1fb25d8609
commit 74e40cebb1
6 changed files with 17 additions and 10 deletions

View File

@ -242,6 +242,14 @@ IntRectTyped<units> RoundedOut(const RectTyped<units>& aRect)
int32_t(copy.height));
}
template<class units>
IntRectTyped<units> TruncatedToInt(const RectTyped<units>& aRect) {
return IntRectTyped<units>(int32_t(aRect.x),
int32_t(aRect.y),
int32_t(aRect.width),
int32_t(aRect.height));
}
template<class units>
RectTyped<units> IntRectToRect(const IntRectTyped<units>& aRect)
{

View File

@ -859,10 +859,8 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion)
}
// Allow widget to render a custom background.
mCompositor->GetWidget()->DrawWindowUnderlay(this, IntRect(actualBounds.x,
actualBounds.y,
actualBounds.width,
actualBounds.height));
mCompositor->GetWidget()->DrawWindowUnderlay(
this, LayoutDeviceIntRect::FromUnknownRect(TruncatedToInt(actualBounds)));
RefPtr<CompositingRenderTarget> previousTarget;
if (haveLayerEffects) {
@ -891,8 +889,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion)
// Allow widget to render a custom foreground.
mCompositor->GetWidget()->DrawWindowOverlay(
this, LayoutDeviceIntRect(actualBounds.x, actualBounds.y,
actualBounds.width, actualBounds.height));
this, LayoutDeviceIntRect::FromUnknownRect(TruncatedToInt(actualBounds)));
// Debugging
RenderDebugOverlay(actualBounds);

View File

@ -2606,7 +2606,8 @@ nsWindow::GetIMEUpdatePreference()
}
void
nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect)
nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager,
LayoutDeviceIntRect aRect)
{
GeckoLayerClient::LocalRef client = AndroidBridge::Bridge()->GetLayerClient();
if (!client) {

View File

@ -151,7 +151,7 @@ public:
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) override;
virtual bool NeedsPaint() override;
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) override;
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
virtual void DrawWindowOverlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
virtual mozilla::layers::CompositorParent* NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight) override;

View File

@ -166,7 +166,7 @@ public:
virtual void CleanupWindowEffects() override {}
virtual bool PreRender(LayerManagerComposite* aManager) override { return true; }
virtual void PostRender(LayerManagerComposite* aManager) override {}
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) override {}
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override {}
virtual void DrawWindowOverlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override {}
virtual already_AddRefed<mozilla::gfx::DrawTarget> StartRemoteDrawing() override;
virtual void EndRemoteDrawing() override { };

View File

@ -1225,7 +1225,8 @@ class nsIWidget : public nsISupports {
*
* Always called from the compositing thread.
*/
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) = 0;
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager,
LayoutDeviceIntRect aRect) = 0;
/**
* Called after the LayerManager draws the layer tree