Bug 1162587 - Part 2: Abort painting a painted layer when a device reset has ocurred. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Fri, 08 May 2015 23:12:32 +0200
changeset 274434 472bbac750e4dfcd66c8ef31ce73fb4d3010d0dc
parent 274433 216a53da7af892433c7d9dd810659e46313d9d09
child 274435 195378b660791a6b0c21e7180621a48125a4c71e
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1162587
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1162587 - Part 2: Abort painting a painted layer when a device reset has ocurred. r=jrmuizel
gfx/layers/client/ClientPaintedLayer.cpp
--- a/gfx/layers/client/ClientPaintedLayer.cpp
+++ b/gfx/layers/client/ClientPaintedLayer.cpp
@@ -20,24 +20,35 @@
 #include "mozilla/Preferences.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsISupportsImpl.h"            // for Layer::AddRef, etc
 #include "nsRect.h"                     // for mozilla::gfx::IntRect
 #include "gfx2DGlue.h"
 #include "ReadbackProcessor.h"
 
+#ifdef XP_WIN
+#include "gfxWindowsPlatform.h"
+#endif
+
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::gfx;
 
 void
 ClientPaintedLayer::PaintThebes()
 {
+#ifdef XP_WIN
+  if (gfxWindowsPlatform::GetPlatform()->DidRenderingDeviceReset()) {
+    // If our rendering device has reset simply avoid rendering completely.
+    return;
+  }
+#endif
+
   PROFILER_LABEL("ClientPaintedLayer", "PaintThebes",
     js::ProfileEntry::Category::GRAPHICS);
 
   NS_ASSERTION(ClientManager()->InDrawing(),
                "Can only draw in drawing phase");
   
   uint32_t flags = RotatedContentBuffer::PAINT_CAN_DRAW_ROTATED;
 #ifndef MOZ_IGNORE_PAINT_WILL_RESAMPLE