Bug 1297828 - Add GraphicsError to PGPU r=dvander
authorGeorge Wright <george@mozilla.com>
Fri, 30 Sep 2016 17:31:06 -0400
changeset 316978 41be8df2876648875b362ce89df223343aef08dd
parent 316977 3c560d4ed804f2ec17da977f4a4271539fe88c15
child 316979 8aefe3650d8d5b75cb61c98c92f709f4cd9d0e29
push id82577
push usergwright@mozilla.com
push dateFri, 07 Oct 2016 15:49:33 +0000
treeherdermozilla-inbound@8aefe3650d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1297828
milestone52.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 1297828 - Add GraphicsError to PGPU r=dvander
gfx/ipc/GPUChild.cpp
gfx/ipc/GPUChild.h
gfx/ipc/PGPU.ipdl
--- a/gfx/ipc/GPUChild.cpp
+++ b/gfx/ipc/GPUChild.cpp
@@ -96,16 +96,28 @@ GPUChild::RecvInitComplete(const GPUDevi
 
 bool
 GPUChild::RecvReportCheckerboard(const uint32_t& aSeverity, const nsCString& aLog)
 {
   layers::CheckerboardEventStorage::Report(aSeverity, std::string(aLog.get()));
   return true;
 }
 
+bool
+GPUChild::RecvGraphicsError(const nsCString& aError)
+{
+  gfx::LogForwarder* lf = gfx::Factory::GetLogForwarder();
+  if (lf) {
+    std::stringstream message;
+    message << "GP+" << aError.get();
+    lf->UpdateStringsVector(message.str());
+  }
+  return true;
+}
+
 void
 GPUChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   gfxVars::RemoveReceiver(this);
   mHost->OnChannelClosed();
 }
 
 class DeferredDeleteGPUChild : public Runnable
--- a/gfx/ipc/GPUChild.h
+++ b/gfx/ipc/GPUChild.h
@@ -30,16 +30,17 @@ public:
 
   // gfxVarReceiver overrides.
   void OnVarChanged(const GfxVarUpdate& aVar) override;
 
   // PGPUChild overrides.
   bool RecvInitComplete(const GPUDeviceData& aData) override;
   bool RecvReportCheckerboard(const uint32_t& aSeverity, const nsCString& aLog) override;
   void ActorDestroy(ActorDestroyReason aWhy) override;
+  bool RecvGraphicsError(const nsCString& aError) override;
 
   static void Destroy(UniquePtr<GPUChild>&& aChild);
 
 private:
   GPUProcessHost* mHost;
   bool mGPUReady;
 };
 
--- a/gfx/ipc/PGPU.ipdl
+++ b/gfx/ipc/PGPU.ipdl
@@ -70,12 +70,15 @@ parent:
 
 child:
   // Sent when the GPU process has initialized devices. This occurs once, after
   // Init().
   async InitComplete(GPUDeviceData data);
 
   // Sent when APZ detects checkerboarding and apz checkerboard reporting is enabled.
   async ReportCheckerboard(uint32_t severity, nsCString log);
+
+  // Graphics errors, analogous to PContent::GraphicsError
+  async GraphicsError(nsCString aError);
 };
 
 } // namespace gfx
 } // namespace mozilla