image_transport_surface_delegate.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2016 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 GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_
  5. #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_
  6. #include "base/callback.h"
  7. #include "build/build_config.h"
  8. #include "components/viz/common/gpu/gpu_vsync_callback.h"
  9. #include "gpu/ipc/common/surface_handle.h"
  10. #include "gpu/ipc/service/gpu_ipc_service_export.h"
  11. #include "ui/gfx/gpu_fence_handle.h"
  12. namespace gpu {
  13. struct GpuPreferences;
  14. namespace gles2 {
  15. class FeatureInfo;
  16. }
  17. class GPU_IPC_SERVICE_EXPORT ImageTransportSurfaceDelegate {
  18. public:
  19. #if BUILDFLAG(IS_WIN)
  20. // Tells the delegate that a child window was created with the provided
  21. // SurfaceHandle.
  22. virtual void DidCreateAcceleratedSurfaceChildWindow(
  23. SurfaceHandle parent_window,
  24. SurfaceHandle child_window) = 0;
  25. #endif
  26. // Returns the features available for the ContextGroup.
  27. virtual const gles2::FeatureInfo* GetFeatureInfo() const = 0;
  28. virtual const GpuPreferences& GetGpuPreferences() const = 0;
  29. // Callback for GPU vsync signal. May be called on a different thread.
  30. virtual viz::GpuVSyncCallback GetGpuVSyncCallback() = 0;
  31. // Returns how long GpuThread was blocked since last swap. Used for metrics.
  32. virtual base::TimeDelta GetGpuBlockedTimeSinceLastSwap() = 0;
  33. protected:
  34. virtual ~ImageTransportSurfaceDelegate() = default;
  35. };
  36. } // namespace gpu
  37. #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_