Change Compositor::GetWidget to return a CompositorWidgetProxy. (bug 1264545 part 3, r=jimm)

This commit is contained in:
David Anderson 2016-04-29 19:20:41 -04:00
Родитель 9c4fea9c31
Коммит 1c7b3ca999
5 изменённых файлов: 9 добавлений и 24 удалений

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

@ -474,7 +474,7 @@ public:
virtual void ForcePresent() { } virtual void ForcePresent() { }
nsIWidget* GetWidget() const { return mWidget; } widget::CompositorWidgetProxy* GetWidget() const { return mWidget; }
virtual bool HasImageHostOverlays() { return false; } virtual bool HasImageHostOverlays() { return false; }

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

@ -853,7 +853,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
if (!mTarget && !haveLayerEffects && if (!mTarget && !haveLayerEffects &&
gfxPrefs::Composer2DCompositionEnabled() && gfxPrefs::Composer2DCompositionEnabled() &&
composer2D && composer2D->HasHwc() && composer2D->TryRenderWithHwc(mRoot, composer2D && composer2D->HasHwc() && composer2D->TryRenderWithHwc(mRoot,
mCompositor->GetWidget(), mCompositor->GetWidget()->RealWidget(),
mGeometryChanged, mGeometryChanged,
mCompositor->HasImageHostOverlays())) mCompositor->HasImageHostOverlays()))
{ {
@ -942,12 +942,13 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
js::ProfileEntry::Category::GRAPHICS); js::ProfileEntry::Category::GRAPHICS);
mCompositor->EndFrame(); mCompositor->EndFrame();
mCompositor->SetDispAcquireFence(mRoot,
mCompositor->GetWidget()); // Call after EndFrame() // Call after EndFrame()
mCompositor->SetDispAcquireFence(mRoot, mCompositor->GetWidget()->RealWidget());
} }
if (composer2D) { if (composer2D) {
composer2D->Render(mCompositor->GetWidget()); composer2D->Render(mCompositor->GetWidget()->RealWidget());
} }
mCompositor->GetWidget()->PostRender(this); mCompositor->GetWidget()->PostRender(this);
@ -1546,7 +1547,7 @@ LayerComposite::SetLayerManager(LayerManagerComposite* aManager)
bool bool
LayerManagerComposite::AsyncPanZoomEnabled() const LayerManagerComposite::AsyncPanZoomEnabled() const
{ {
return mCompositor->GetWidget()->AsyncPanZoomEnabled(); return mCompositor->GetWidget()->RealWidget()->AsyncPanZoomEnabled();
} }
nsIntRegion nsIntRegion

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

@ -51,7 +51,7 @@ CompositingRenderTargetOGL::BindRenderTarget()
// The main framebuffer (0) of non-offscreen contexts // The main framebuffer (0) of non-offscreen contexts
// might be backed by a EGLSurface that needs to be renewed. // might be backed by a EGLSurface that needs to be renewed.
if (mFBO == 0 && !mGL->IsOffscreen()) { if (mFBO == 0 && !mGL->IsOffscreen()) {
mGL->RenewSurface(mCompositor->GetWidget()); mGL->RenewSurface(mCompositor->GetWidget()->RealWidget());
result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
} }
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) { if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {

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

@ -1599,7 +1599,7 @@ CompositorOGL::Resume()
return false; return false;
// RenewSurface internally calls MakeCurrent. // RenewSurface internally calls MakeCurrent.
return gl()->RenewSurface(GetWidget()); return gl()->RenewSurface(GetWidget()->RealWidget());
#endif #endif
return true; return true;
} }

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

@ -1248,16 +1248,6 @@ class nsIWidget
*/ */
virtual void PrepareWindowEffects() = 0; virtual void PrepareWindowEffects() = 0;
/**
* A hook for the widget to prepare a Compositor, during the latter's initialization.
*
* If this method returns true, it means that the widget will be able to
* present frames from the compoositor.
* Returning false will cause the compositor's initialization to fail, and
* a different compositor backend will be used (if any).
*/
virtual bool InitCompositor(mozilla::layers::Compositor*) { return true; }
/** /**
* Called when Gecko knows which themed widgets exist in this window. * Called when Gecko knows which themed widgets exist in this window.
* The passed array contains an entry for every themed widget of the right * The passed array contains an entry for every themed widget of the right
@ -1856,12 +1846,6 @@ public:
*/ */
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) = 0; NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) = 0;
/**
* Return the internal format of the default framebuffer for this
* widget.
*/
virtual uint32_t GetGLFrameBufferFormat() { return 0; /*GL_NONE*/ }
/** /**
* Return true if widget has it's own GL context * Return true if widget has it's own GL context
*/ */