fake_display_client.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_FAKE_DISPLAY_CLIENT_H_
  5. #define COMPONENTS_VIZ_TEST_FAKE_DISPLAY_CLIENT_H_
  6. #include "build/build_config.h"
  7. #include "mojo/public/cpp/bindings/pending_remote.h"
  8. #include "mojo/public/cpp/bindings/receiver.h"
  9. #include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
  10. namespace viz {
  11. class FakeDisplayClient : public mojom::DisplayClient {
  12. public:
  13. FakeDisplayClient();
  14. FakeDisplayClient(const FakeDisplayClient&) = delete;
  15. FakeDisplayClient& operator=(const FakeDisplayClient&) = delete;
  16. ~FakeDisplayClient() override;
  17. mojo::PendingRemote<mojom::DisplayClient> BindRemote();
  18. // mojom::DisplayClient implementation.
  19. #if BUILDFLAG(IS_APPLE)
  20. void OnDisplayReceivedCALayerParams(
  21. const gfx::CALayerParams& ca_layer_params) override;
  22. #endif
  23. #if BUILDFLAG(IS_WIN)
  24. void CreateLayeredWindowUpdater(
  25. mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) override;
  26. #endif
  27. #if BUILDFLAG(IS_LINUX)
  28. void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
  29. #endif
  30. private:
  31. mojo::Receiver<mojom::DisplayClient> receiver_{this};
  32. };
  33. } // namespace viz
  34. #endif // COMPONENTS_VIZ_TEST_FAKE_DISPLAY_CLIENT_H_