cast_content_gpu_client.cc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include "chromecast/gpu/cast_content_gpu_client.h"
  5. #include "base/memory/ptr_util.h"
  6. #include "base/task/single_thread_task_runner.h"
  7. #include "components/viz/service/display/overlay_strategy_underlay_cast.h"
  8. #include "content/public/child/child_thread.h"
  9. namespace chromecast {
  10. namespace shell {
  11. CastContentGpuClient::CastContentGpuClient() = default;
  12. CastContentGpuClient::~CastContentGpuClient() = default;
  13. // static
  14. std::unique_ptr<CastContentGpuClient> CastContentGpuClient::Create() {
  15. return base::WrapUnique(new CastContentGpuClient());
  16. }
  17. void CastContentGpuClient::PostCompositorThreadCreated(
  18. base::SingleThreadTaskRunner* task_runner) {
  19. DCHECK(task_runner);
  20. mojo::PendingRemote<chromecast::media::mojom::VideoGeometrySetter>
  21. video_geometry_setter;
  22. content::ChildThread::Get()->BindHostReceiver(
  23. video_geometry_setter.InitWithNewPipeAndPassReceiver());
  24. task_runner->PostTask(
  25. FROM_HERE,
  26. base::BindOnce(
  27. &viz::OverlayStrategyUnderlayCast::ConnectVideoGeometrySetter,
  28. std::move(video_geometry_setter)));
  29. }
  30. } // namespace shell
  31. } // namespace chromecast