stub_surface_client.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2019 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_TEST_STUB_SURFACE_CLIENT_H_
  5. #define COMPONENTS_VIZ_TEST_STUB_SURFACE_CLIENT_H_
  6. #include <vector>
  7. #include "components/viz/service/surfaces/surface_client.h"
  8. #include "base/memory/weak_ptr.h"
  9. namespace viz {
  10. class StubSurfaceClient : public SurfaceClient {
  11. public:
  12. StubSurfaceClient();
  13. ~StubSurfaceClient() override;
  14. void OnSurfaceCommitted(Surface* surface) override {}
  15. void OnSurfaceActivated(Surface* surface) override {}
  16. void OnSurfaceDestroyed(Surface* surface) override {}
  17. void OnSurfaceWillDraw(Surface* surface) override {}
  18. void RefResources(
  19. const std::vector<TransferableResource>& resources) override {}
  20. void UnrefResources(std::vector<ReturnedResource> resources) override {}
  21. void ReturnResources(std::vector<ReturnedResource> resources) override {}
  22. void ReceiveFromChild(
  23. const std::vector<TransferableResource>& resources) override {}
  24. std::vector<PendingCopyOutputRequest> TakeCopyOutputRequests(
  25. const LocalSurfaceId& latest_surface_id) override;
  26. void OnFrameTokenChanged(uint32_t frame_token) override {}
  27. void SendCompositorFrameAck() override {}
  28. void OnSurfaceAggregatedDamage(
  29. Surface* surface,
  30. const LocalSurfaceId& local_surface_id,
  31. const CompositorFrame& frame,
  32. const gfx::Rect& damage_rect,
  33. base::TimeTicks expected_display_time) override {}
  34. void OnSurfacePresented(uint32_t frame_token,
  35. base::TimeTicks draw_start_timestamp,
  36. const gfx::SwapTimings& swap_timings,
  37. const gfx::PresentationFeedback& feedback) override {}
  38. bool IsVideoCaptureStarted() override;
  39. base::flat_set<base::PlatformThreadId> GetThreadIds() override;
  40. base::WeakPtrFactory<StubSurfaceClient> weak_factory{this};
  41. };
  42. } // namespace viz
  43. #endif // COMPONENTS_VIZ_TEST_STUB_SURFACE_CLIENT_H_