Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/ui/ws/frame_generator.h" | 5 #include "services/ui/ws/frame_generator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/containers/adapters.h" | 9 #include "base/containers/adapters.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 // FrameGenerator during destruction of |compositor_frame_sink_|. | 36 // FrameGenerator during destruction of |compositor_frame_sink_|. |
| 37 weak_factory_.InvalidateWeakPtrs(); | 37 weak_factory_.InvalidateWeakPtrs(); |
| 38 compositor_frame_sink_.reset(); | 38 compositor_frame_sink_.reset(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void FrameGenerator::OnAcceleratedWidgetAvailable( | 41 void FrameGenerator::OnAcceleratedWidgetAvailable( |
| 42 gfx::AcceleratedWidget widget) { | 42 gfx::AcceleratedWidget widget) { |
| 43 DCHECK_NE(gfx::kNullAcceleratedWidget, widget); | 43 DCHECK_NE(gfx::kNullAcceleratedWidget, widget); |
| 44 cc::mojom::MojoCompositorFrameSinkRequest request = | 44 cc::mojom::MojoCompositorFrameSinkRequest request = |
| 45 mojo::GetProxy(&compositor_frame_sink_); | 45 mojo::GetProxy(&compositor_frame_sink_); |
| 46 cc::mojom::DisplayPrivatePtr display_private; | |
|
Fady Samuel
2016/12/16 05:29:39
I think FrameGenerator probably wants to hold onto
Alex Z.
2016/12/16 16:42:00
Done.
| |
| 47 cc::mojom::DisplayPrivateRequest display_request = | |
| 48 mojo::GetProxy(&display_private); | |
| 46 root_window_->CreateDisplayCompositorFrameSink( | 49 root_window_->CreateDisplayCompositorFrameSink( |
| 47 widget, std::move(request), binding_.CreateInterfacePtrAndBind()); | 50 widget, std::move(request), binding_.CreateInterfacePtrAndBind(), |
| 51 std::move(display_private), std::move(display_request)); | |
| 48 // TODO(fsamuel): This means we're always requesting a new BeginFrame signal | 52 // TODO(fsamuel): This means we're always requesting a new BeginFrame signal |
| 49 // even when we don't need it. Once surface ID propagation work is done, | 53 // even when we don't need it. Once surface ID propagation work is done, |
| 50 // this will not be necessary because FrameGenerator will only need a | 54 // this will not be necessary because FrameGenerator will only need a |
| 51 // BeginFrame if the window manager changes. | 55 // BeginFrame if the window manager changes. |
| 52 compositor_frame_sink_->SetNeedsBeginFrame(true); | 56 compositor_frame_sink_->SetNeedsBeginFrame(true); |
| 53 } | 57 } |
| 54 | 58 |
| 55 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceId& surface_id, | 59 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 56 ServerWindow* window) { | 60 ServerWindow* window) { |
| 57 DCHECK(surface_id.is_valid()); | 61 DCHECK(surface_id.is_valid()); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 cc::SurfaceId underlay_surface_id = | 346 cc::SurfaceId underlay_surface_id = |
| 343 window->compositor_frame_sink_manager()->GetLatestSurfaceId( | 347 window->compositor_frame_sink_manager()->GetLatestSurfaceId( |
| 344 mojom::CompositorFrameSinkType::UNDERLAY); | 348 mojom::CompositorFrameSinkType::UNDERLAY); |
| 345 if (underlay_surface_id.is_valid()) | 349 if (underlay_surface_id.is_valid()) |
| 346 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); | 350 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); |
| 347 } | 351 } |
| 348 | 352 |
| 349 } // namespace ws | 353 } // namespace ws |
| 350 | 354 |
| 351 } // namespace ui | 355 } // namespace ui |
| OLD | NEW |