GPUChild.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef _include_mozilla_gfx_ipc_GPUChild_h_
  6. #define _include_mozilla_gfx_ipc_GPUChild_h_
  7. #include "mozilla/RefPtr.h"
  8. #include "mozilla/UniquePtr.h"
  9. #include "mozilla/gfx/PGPUChild.h"
  10. #include "mozilla/gfx/gfxVarReceiver.h"
  11. namespace mozilla {
  12. namespace gfx {
  13. class GPUProcessHost;
  14. class GPUChild final
  15. : public PGPUChild,
  16. public gfxVarReceiver
  17. {
  18. public:
  19. explicit GPUChild(GPUProcessHost* aHost);
  20. ~GPUChild();
  21. void Init();
  22. void EnsureGPUReady();
  23. // gfxVarReceiver overrides.
  24. void OnVarChanged(const GfxVarUpdate& aVar) override;
  25. // PGPUChild overrides.
  26. bool RecvInitComplete(const GPUDeviceData& aData) override;
  27. bool RecvReportCheckerboard(const uint32_t& aSeverity, const nsCString& aLog) override;
  28. void ActorDestroy(ActorDestroyReason aWhy) override;
  29. bool RecvGraphicsError(const nsCString& aError) override;
  30. bool RecvNotifyUiObservers(const nsCString& aTopic) override;
  31. bool RecvNotifyDeviceReset() override;
  32. static void Destroy(UniquePtr<GPUChild>&& aChild);
  33. private:
  34. GPUProcessHost* mHost;
  35. bool mGPUReady;
  36. };
  37. } // namespace gfx
  38. } // namespace mozilla
  39. #endif // _include_mozilla_gfx_ipc_GPUChild_h_