Bug 612103 - Part 0.5: Add ReportFailure for D3D10 Layers. r=jrmuizel a=blocking-final
authorBas Schouten <bschouten@mozilla.com>
Wed, 12 Jan 2011 01:52:25 +0100
changeset 60333 5a1e9d51d095780df38afed793795c93afb40154
parent 60332 3b220192f78c8d0f81e000dd2e2a12cdde0a3117
child 60334 04ae4e309307427ebf8927073ac2edc3f3968d88
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, blocking-final
bugs612103
milestone2.0b10pre
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 612103 - Part 0.5: Add ReportFailure for D3D10 Layers. r=jrmuizel a=blocking-final
gfx/layers/d3d10/LayerManagerD3D10.cpp
gfx/layers/d3d10/LayerManagerD3D10.h
--- a/gfx/layers/d3d10/LayerManagerD3D10.cpp
+++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp
@@ -532,15 +532,26 @@ LayerManagerD3D10::PaintToTarget()
 
   mTarget->SetSource(tmpSurface);
   mTarget->SetOperator(gfxContext::OPERATOR_OVER);
   mTarget->Paint();
 
   readTexture->Unmap(0);
 }
 
+void
+LayerManagerD3D10::ReportFailure(const nsACString &aMsg, HRESULT aCode)
+{
+  // We could choose to abort here when hr == E_OUTOFMEMORY.
+  nsCString msg;
+  msg.Append(aMsg);
+  msg.AppendLiteral(" Error code: ");
+  msg.AppendInt(PRUint32(aCode));
+  NS_WARNING(msg.BeginReading());
+}
+
 LayerD3D10::LayerD3D10(LayerManagerD3D10 *aManager)
   : mD3DManager(aManager)
 {
 }
 
 }
 }
--- a/gfx/layers/d3d10/LayerManagerD3D10.h
+++ b/gfx/layers/d3d10/LayerManagerD3D10.h
@@ -136,16 +136,18 @@ public:
 
   ID3D10Device1 *device() const { return mDevice; }
 
   ID3D10Effect *effect() const { return mEffect; }
 
   void SetViewport(const nsIntSize &aViewport);
   const nsIntSize &GetViewport() { return mViewport; }
 
+  static void LayerManagerD3D10::ReportFailure(const nsACString &aMsg, HRESULT aCode);
+
 private:
   void SetupPipeline();
   void UpdateRenderTarget();
   void VerifyBufferSize();
 
   void Render();
 
   nsRefPtr<ID3D10Device1> mDevice;