Bug 1272277 - Force content process device reset when the compositor is updated - r=nical

This commit is contained in:
Edwin Flores 2016-05-16 12:55:02 +01:00
parent b705cc93b6
commit 662e4f47a3
4 changed files with 14 additions and 2 deletions

View File

@ -3018,7 +3018,7 @@ TabChild::InvalidateLayers()
void
TabChild::CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier)
{
gfxPlatform::GetPlatform()->UpdateRenderModeIfDeviceReset();
gfxPlatform::GetPlatform()->CompositorUpdated();
RefPtr<LayerManager> lm = mPuppetWidget->GetLayerManager();
ClientLayerManager* clm = lm->AsClientLayerManager();

View File

@ -136,7 +136,8 @@ enum class DeviceResetReason
enum class ForcedDeviceResetReason
{
OPENSHAREDHANDLE = 0
OPENSHAREDHANDLE = 0,
COMPOSITOR_UPDATED,
};
class gfxPlatform {
@ -633,6 +634,8 @@ public:
return mCompositorBackend;
}
virtual void CompositorUpdated() {}
// Return information on how child processes should initialize graphics
// devices. Currently this is only used on Windows.
virtual void GetDeviceInitData(mozilla::gfx::DeviceInitData* aOut);

View File

@ -947,6 +947,13 @@ static DeviceResetReason HResultToResetReason(HRESULT hr)
return DeviceResetReason::UNKNOWN;
}
void
gfxWindowsPlatform::CompositorUpdated()
{
ForceDeviceReset(ForcedDeviceResetReason::COMPOSITOR_UPDATED);
UpdateRenderMode();
}
bool
gfxWindowsPlatform::IsDeviceReset(HRESULT hr, DeviceResetReason* aResetReason)
{

View File

@ -178,6 +178,8 @@ public:
*/
virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags) override;
virtual void CompositorUpdated() override;
bool DidRenderingDeviceReset(DeviceResetReason* aResetReason = nullptr) override;
void SchedulePaintIfDeviceReset() override;
void UpdateRenderModeIfDeviceReset() override;