Bug 1217192 - Use gfxCriticalNote where we're already using the non-default construction parameter. r=mchang
authorMilan Sreckovic <milan@mozilla.com>
Wed, 21 Oct 2015 14:34:00 +0200
changeset 304367 8315a152ccb1cb77d57652daf7ce5ab688582ced
parent 304366 e33fcdc71dd67b361e3d747ebf5a321a4af5f00d
child 304368 b8ca53e9a3a02d9dcbaf7da16b6f0b3c36671743
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchang
bugs1217192
milestone44.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 1217192 - Use gfxCriticalNote where we're already using the non-default construction parameter. r=mchang
gfx/2d/DrawTargetCairo.cpp
gfx/2d/DrawTargetD2D.cpp
gfx/2d/DrawTargetD2D1.cpp
gfx/layers/d3d11/CompositorD3D11.cpp
gfx/layers/d3d11/TextureD3D11.cpp
gfx/src/DriverCrashGuard.cpp
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxWindowsSurface.cpp
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -1095,17 +1095,17 @@ DrawTargetCairo::CopyRect(const IntRect 
 void
 DrawTargetCairo::ClearRect(const Rect& aRect)
 {
   AutoPrepareForDrawing prep(this, mContext);
 
   if (!mContext || aRect.Width() <= 0 || aRect.Height() <= 0 ||
       !IsFinite(aRect.X()) || !IsFinite(aRect.Width()) ||
       !IsFinite(aRect.Y()) || !IsFinite(aRect.Height())) {
-    gfxCriticalError(CriticalLog::DefaultOptions(false)) << "ClearRect with invalid argument " << gfx::hexa(mContext) << " with " << aRect.Width() << "x" << aRect.Height() << " [" << aRect.X() << ", " << aRect.Y() << "]";
+    gfxCriticalNote << "ClearRect with invalid argument " << gfx::hexa(mContext) << " with " << aRect.Width() << "x" << aRect.Height() << " [" << aRect.X() << ", " << aRect.Y() << "]";
   }
 
   cairo_set_antialias(mContext, CAIRO_ANTIALIAS_NONE);
   cairo_new_path(mContext);
   cairo_set_operator(mContext, CAIRO_OPERATOR_CLEAR);
   cairo_rectangle(mContext, aRect.X(), aRect.Y(),
                   aRect.Width(), aRect.Height());
   cairo_fill(mContext);
--- a/gfx/2d/DrawTargetD2D.cpp
+++ b/gfx/2d/DrawTargetD2D.cpp
@@ -135,17 +135,17 @@ public:
     invClippedArea->Open(getter_AddRefs(sink));
 
     rectGeom->CombineWithGeometry(mClippedArea, D2D1_COMBINE_MODE_EXCLUDE, nullptr, sink);
     sink->Close();
 
     RefPtr<ID2D1BitmapBrush> brush;
     HRESULT hr = rt->CreateBitmapBrush(mOldSurfBitmap, D2D1::BitmapBrushProperties(), D2D1::BrushProperties(), getter_AddRefs(brush));
     if (FAILED(hr)) {
-      gfxCriticalError(CriticalLog::DefaultOptions(false)) << "[D2D] CreateBitmapBrush failure " << hexa(hr);
+      gfxCriticalNote << "[D2D] CreateBitmapBrush failure " << hexa(hr);
       return;
     }
 
     rt->FillGeometry(invClippedArea, brush);
   }
 
 private:
 
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -900,17 +900,17 @@ DrawTargetD2D1::Init(const IntSize &aSiz
   if (FAILED(hr)) {
     gfxCriticalError() <<"[D2D1.1] 2Failed to create a DeviceContext, code: " << hexa(hr) << " format " << (int)aFormat;
     return false;
   }
 
   if (mDC->GetMaximumBitmapSize() < UINT32(aSize.width) ||
       mDC->GetMaximumBitmapSize() < UINT32(aSize.height)) {
     // This is 'ok', so don't assert
-    gfxCriticalError(CriticalLog::DefaultOptions(false)) << "[D2D1.1] Attempt to use unsupported surface size " << aSize;
+    gfxCriticalNote << "[D2D1.1] Attempt to use unsupported surface size " << aSize;
     return false;
   }
 
   D2D1_BITMAP_PROPERTIES1 props;
   props.dpiX = 96;
   props.dpiY = 96;
   props.pixelFormat = D2DPixelFormat(aFormat);
   props.colorContext = nullptr;
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -130,18 +130,17 @@ private:
       mInitOkay = false;
     }
   }
 
   bool Failed(HRESULT hr, const char* aContext) {
     if (SUCCEEDED(hr))
       return false;
 
-    gfxCriticalError(CriticalLog::DefaultOptions(false))
-      << "[D3D11] " << aContext << " failed: " << hexa(hr);
+    gfxCriticalNote << "[D3D11] " << aContext << " failed: " << hexa(hr);
     return true;
   }
 
   // Only used during initialization.
   RefPtr<ID3D11Device> mDevice;
   bool mInitOkay;
 };
 
@@ -193,18 +192,17 @@ CompositorD3D11::Initialize()
 
   if (!mDevice) {
     return false;
   }
 
   mDevice->GetImmediateContext(getter_AddRefs(mContext));
 
   if (!mContext) {
-    gfxCriticalError(CriticalLog::DefaultOptions(false))
-      << "[D3D11] failed to get immediate context";
+    gfxCriticalNote << "[D3D11] failed to get immediate context";
     return false;
   }
 
   mFeatureLevel = mDevice->GetFeatureLevel();
 
   mHwnd = (HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW);
 
   memset(&mVSConstants, 0, sizeof(VertexShaderConstants));
@@ -480,17 +478,17 @@ CompositorD3D11::CreateRenderTarget(cons
   }
 
   CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, aRect.width, aRect.height, 1, 1,
                              D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
 
   RefPtr<ID3D11Texture2D> texture;
   HRESULT hr = mDevice->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture));
   if (Failed(hr) || !texture) {
-    gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Failed in CreateRenderTarget";
+    gfxCriticalNote << "Failed in CreateRenderTarget " << hexa(hr);
     return nullptr;
   }
 
   RefPtr<CompositingRenderTargetD3D11> rt = new CompositingRenderTargetD3D11(texture, aRect.TopLeft());
   rt->SetSize(IntSize(aRect.width, aRect.height));
 
   if (aInit == INIT_MODE_CLEAR) {
     FLOAT clear[] = { 0, 0, 0, 0 };
@@ -514,17 +512,17 @@ CompositorD3D11::CreateRenderTargetFromS
   CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM,
                              aRect.width, aRect.height, 1, 1,
                              D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
 
   RefPtr<ID3D11Texture2D> texture;
   HRESULT hr = mDevice->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture));
   NS_ASSERTION(texture, "Could not create texture");
   if (Failed(hr) || !texture) {
-    gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Failed in CreateRenderTargetFromSource";
+    gfxCriticalNote << "Failed in CreateRenderTargetFromSource " << hexa(hr);
     return nullptr;
   }
 
   if (aSource) {
     const CompositingRenderTargetD3D11* sourceD3D11 =
       static_cast<const CompositingRenderTargetD3D11*>(aSource);
 
     D3D11_BOX srcBox;
@@ -1230,43 +1228,43 @@ CompositorD3D11::VerifyBufferSize()
   return Succeeded(hr);
 }
 
 void
 CompositorD3D11::UpdateRenderTarget()
 {
   EnsureSize();
   if (!VerifyBufferSize()) {
-    gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Failed VerifyBufferSize in UpdateRenderTarget " << mSize;
+    gfxCriticalNote << "Failed VerifyBufferSize in UpdateRenderTarget " << mSize;
     return;
   }
 
   if (mDefaultRT) {
     return;
   }
 
   if (mSize.width <= 0 || mSize.height <= 0) {
-    gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Invalid size in UpdateRenderTarget " << mSize;
+    gfxCriticalNote << "Invalid size in UpdateRenderTarget " << mSize;
     return;
   }
 
   HRESULT hr;
 
   RefPtr<ID3D11Texture2D> backBuf;
 
   hr = mSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)backBuf.StartAssignment());
   if (hr == DXGI_ERROR_INVALID_CALL) {
     // This happens on some GPUs/drivers when there's a TDR.
     if (mDevice->GetDeviceRemovedReason() != S_OK) {
       gfxCriticalError() << "GetBuffer returned invalid call!";
       return;
     }
   }
   if (Failed(hr)) {
-    gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Failed in UpdateRenderTarget";
+    gfxCriticalNote << "Failed in UpdateRenderTarget " << hexa(hr);
     return;
   }
 
   mDefaultRT = new CompositingRenderTargetD3D11(backBuf, IntPoint(0, 0));
   mDefaultRT->SetSize(mSize);
 }
 
 bool
@@ -1439,18 +1437,17 @@ CompositorD3D11::PaintToTarget()
 }
 
 bool
 CompositorD3D11::Failed(HRESULT hr, const char* aContext)
 {
   if (SUCCEEDED(hr))
     return false;
 
-  gfxCriticalError(CriticalLog::DefaultOptions(false))
-    << "[D3D11] " << aContext << " failed: " << hexa(hr);
+  gfxCriticalNote << "[D3D11] " << aContext << " failed: " << hexa(hr);
   return true;
 }
 
 void
 CompositorD3D11::HandleError(HRESULT hr, Severity aSeverity)
 {
   if (SUCCEEDED(hr)) {
     return;
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -70,17 +70,17 @@ TextureSourceD3D11::GetShaderResourceVie
 {
   MOZ_ASSERT(mTexture == GetD3D11Texture(), "You need to override GetShaderResourceView if you're overriding GetD3D11Texture!");
 
   if (!mSRV && mTexture) {
     RefPtr<ID3D11Device> device;
     mTexture->GetDevice(getter_AddRefs(device));
     HRESULT hr = device->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRV));
     if (FAILED(hr)) {
-      gfxCriticalError(CriticalLog::DefaultOptions(false)) << "[D3D11] TextureSourceD3D11:GetShaderResourceView CreateSRV failure " << gfx::hexa(hr);
+      gfxCriticalNote << "[D3D11] TextureSourceD3D11:GetShaderResourceView CreateSRV failure " << gfx::hexa(hr);
       return nullptr;
     }
   }
   return mSRV;
 }
 
 DataTextureSourceD3D11::DataTextureSourceD3D11(SurfaceFormat aFormat,
                                                CompositorD3D11* aCompositor,
@@ -1124,17 +1124,17 @@ DataTextureSourceD3D11::GetShaderResourc
       if (!mTileTextures[mCurrentTile]) {
         return nullptr;
       }
       
       RefPtr<ID3D11Device> device;
       mTileTextures[mCurrentTile]->GetDevice(getter_AddRefs(device));
       HRESULT hr = device->CreateShaderResourceView(mTileTextures[mCurrentTile], nullptr, getter_AddRefs(mTileSRVs[mCurrentTile]));
       if (FAILED(hr)) {
-        gfxCriticalError(CriticalLog::DefaultOptions(false)) << "[D3D11] DataTextureSourceD3D11:GetShaderResourceView CreateSRV failure " << gfx::hexa(hr);
+        gfxCriticalNote << "[D3D11] DataTextureSourceD3D11:GetShaderResourceView CreateSRV failure " << gfx::hexa(hr);
         return nullptr;
       }
     }
     return mTileSRVs[mCurrentTile];
   }
 
   return TextureSourceD3D11::GetShaderResourceView();
 }
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -419,24 +419,24 @@ D3D11LayersCrashGuard::UpdateEnvironment
   RecordTelemetry(TelemetryState::EnvironmentChanged);
   return true;
 }
 
 void
 D3D11LayersCrashGuard::LogCrashRecovery()
 {
   RecordTelemetry(TelemetryState::RecoveredFromCrash);
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "D3D11 layers just crashed; D3D11 will be disabled.";
+  gfxCriticalNote << "D3D11 layers just crashed; D3D11 will be disabled.";
 }
 
 void
 D3D11LayersCrashGuard::LogFeatureDisabled()
 {
   RecordTelemetry(TelemetryState::FeatureDisabled);
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "D3D11 layers disabled due to a prior crash.";
+  gfxCriticalNote << "D3D11 layers disabled due to a prior crash.";
 }
 
 void
 D3D11LayersCrashGuard::RecordTelemetry(TelemetryState aState)
 {
   // D3D11LayersCrashGuard is a no-op in the child process.
   if (!XRE_IsParentProcess()) {
     return;
@@ -463,23 +463,23 @@ D3D9VideoCrashGuard::UpdateEnvironment()
 {
   // We don't care about any extra preferences here.
   return false;
 }
 
 void
 D3D9VideoCrashGuard::LogCrashRecovery()
 {
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "DXVA2D3D9 just crashed; hardware video will be disabled.";
+  gfxCriticalNote << "DXVA2D3D9 just crashed; hardware video will be disabled.";
 }
 
 void
 D3D9VideoCrashGuard::LogFeatureDisabled()
 {
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "DXVA2D3D9 video decoding is disabled due to a previous crash.";
+  gfxCriticalNote << "DXVA2D3D9 video decoding is disabled due to a previous crash.";
 }
 
 GLContextCrashGuard::GLContextCrashGuard(dom::ContentParent* aContentParent)
  : DriverCrashGuard(CrashGuardType::GLContext, aContentParent)
 {
 }
 
 void
@@ -520,19 +520,19 @@ GLContextCrashGuard::UpdateEnvironment()
 #endif
 
   return changed;
 }
 
 void
 GLContextCrashGuard::LogCrashRecovery()
 {
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "GLContext just crashed and is now disabled.";
+  gfxCriticalNote << "GLContext just crashed and is now disabled.";
 }
 
 void
 GLContextCrashGuard::LogFeatureDisabled()
 {
-  gfxCriticalError(CriticalLog::DefaultOptions(false)) << "GLContext is disabled due to a previous crash.";
+  gfxCriticalNote << "GLContext is disabled due to a previous crash.";
 }
 
 } // namespace gfx
 } // namespace mozilla
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1907,17 +1907,17 @@ bool DoesD3D11TextureSharingWorkInternal
   {
     return false;
   }
 
   RefPtr<ID3D11ShaderResourceView> sharedView;
 
   // This if(FAILED()) is the one that actually fails on systems affected by bug 1083071.
   if (FAILED(device->CreateShaderResourceView(sharedTexture, NULL, getter_AddRefs(sharedView)))) {
-    gfxCriticalError(CriticalLog::DefaultOptions(false)) << "CreateShaderResourceView failed for format" << format;
+    gfxCriticalNote << "CreateShaderResourceView failed for format" << format;
     return false;
   }
 
   return true;
 }
 
 bool DoesD3D11TextureSharingWork(ID3D11Device *device)
 {
--- a/gfx/thebes/gfxWindowsSurface.cpp
+++ b/gfx/thebes/gfxWindowsSurface.cpp
@@ -26,17 +26,17 @@ gfxWindowsSurface::gfxWindowsSurface(HDC
     if (flags & FLAG_TAKE_DC)
         mOwnsDC = true;
 
 #ifdef NS_PRINTING
     if (flags & FLAG_FOR_PRINTING) {
         Init(cairo_win32_printing_surface_create(mDC));
         mForPrinting = true;
         if (!mSurfaceValid) {
-            gfxCriticalError(gfxCriticalError::DefaultOptions(false)) << "Invalid printing surface";
+            gfxCriticalNote << "Invalid printing surface";
         }
     } else
 #endif
     InitWithDC(flags);
 }
 
 gfxWindowsSurface::gfxWindowsSurface(IDirect3DSurface9 *surface, uint32_t flags) :
     mOwnsDC(false), mForPrinting(false), mDC(0), mWnd(nullptr)