gpu_client_delegate.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_VIZ_HOST_GPU_CLIENT_DELEGATE_H_
  5. #define COMPONENTS_VIZ_HOST_GPU_CLIENT_DELEGATE_H_
  6. #include "mojo/public/cpp/system/message_pipe.h"
  7. namespace viz {
  8. class GpuHostImpl;
  9. class HostGpuMemoryBufferManager;
  10. // Delegate interface that GpuClient uses to get the current GpuHost and/or
  11. // GpuMemoryBufferManager instances. These functions are guaranteed to be called
  12. // on the thread corresponding to GpuClient's task runner.
  13. class GpuClientDelegate {
  14. public:
  15. virtual ~GpuClientDelegate() {}
  16. // Returns the current instance of GpuHostImpl. If GPU service is not running,
  17. // tries to launch it. If the launch is unsuccessful, returns nullptr.
  18. virtual GpuHostImpl* EnsureGpuHost() = 0;
  19. // Returns the current HostGpuMemoryBufferManager instance.
  20. virtual HostGpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
  21. };
  22. } // namespace viz
  23. #endif // COMPONENTS_VIZ_HOST_GPU_CLIENT_DELEGATE_H_