Bug 1273946: Get more information on the cause of the device reset. Remove unused UpdateRenderModeIfDeviceReset method. r?dvander draft
authorMilan Sreckovic <milan@mozilla.com>
Wed, 01 Jun 2016 12:53:25 -0400
changeset 374010 92e8dcd98f0cc59b0daf62e45a0209d812db2087
parent 373211 864cdd00360cdf62ea5132a457ee53a17f9e31aa
child 522521 36afb3d32822873ccad84bd2a891912f358c7162
push id19897
push usermsreckovic@mozilla.com
push dateWed, 01 Jun 2016 16:53:40 +0000
reviewersdvander
bugs1273946
milestone49.0a1
Bug 1273946: Get more information on the cause of the device reset. Remove unused UpdateRenderModeIfDeviceReset method. r?dvander MozReview-Commit-ID: 6NxKTBEKOvs
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxWindowsPlatform.h
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -610,21 +610,16 @@ public:
     bool SupportsApzDragInput() const;
 
     virtual void FlushContentDrawing() {}
 
     // If a device reset has occurred, schedule any necessary paints in the
     // widget. This should only be used within nsRefreshDriver.
     virtual void SchedulePaintIfDeviceReset() {}
 
-    // Immediately update all platform bits if a device reset has occurred.
-    // This should only be used at the top of the callstack (i.e. within
-    // a task, OS event, or IPDL message).
-    virtual void UpdateRenderModeIfDeviceReset() {}
-
     /**
      * Helper method, creates a draw target for a specific Azure backend.
      * Used by CreateOffscreenDrawTarget.
      */
     already_AddRefed<DrawTarget>
       CreateDrawTargetForBackend(mozilla::gfx::BackendType aBackend,
                                  const mozilla::gfx::IntSize& aSize,
                                  mozilla::gfx::SurfaceFormat aFormat);
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1007,36 +1007,27 @@ InvalidateWindowForDeviceReset(HWND aWnd
     return TRUE;
 }
 
 void
 gfxWindowsPlatform::SchedulePaintIfDeviceReset()
 {
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS);
 
-  if (!DidRenderingDeviceReset()) {
+  DeviceResetReason resetReason = DeviceResetReason::OK;
+  if (!DidRenderingDeviceReset(&resetReason)) {
     return;
   }
 
   // Trigger an ::OnPaint for each window.
   ::EnumThreadWindows(GetCurrentThreadId(),
                       InvalidateWindowForDeviceReset,
                       0);
 
-  gfxCriticalNote << "Detected rendering device reset on refresh";
-}
-
-void
-gfxWindowsPlatform::UpdateRenderModeIfDeviceReset()
-{
-  PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS);
-
-  if (DidRenderingDeviceReset()) {
-    UpdateRenderMode();
-  }
+  gfxCriticalNote << "Detected rendering device reset on refresh: " << (int)resetReason;
 }
 
 void
 gfxWindowsPlatform::GetPlatformCMSOutputProfile(void* &mem, size_t &mem_size)
 {
     WCHAR str[MAX_PATH];
     DWORD size = MAX_PATH;
     BOOL res;
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -177,17 +177,16 @@ public:
      * Check whether format is supported on a platform or not (if unclear, returns true)
      */
     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;
 
     mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) override;
 
     // ClearType is not always enabled even when available (e.g. Windows XP)
     // if either of these prefs are enabled and apply, use ClearType rendering
     bool UseClearTypeForDownloadableFonts();
     bool UseClearTypeAlways();