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 24 matching lines...) Expand all Loading... | |
| 35 // Invalidate WeakPtrs now to avoid callbacks back into the | 35 // Invalidate WeakPtrs now to avoid callbacks back into the |
| 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(&compositor_frame_sink_); | 44 cc::mojom::MojoCompositorFrameSinkRequest request(&compositor_frame_sink_); |
| 45 cc::mojom::DisplayPrivatePtr display_private; | |
|
Fady Samuel
2016/12/21 18:09:09
nit: unused variable
Alex Z.
2016/12/21 18:36:14
Done.
| |
| 46 cc::mojom::DisplayPrivateRequest display_private_request(&display_private_); | |
| 45 root_window_->CreateDisplayCompositorFrameSink( | 47 root_window_->CreateDisplayCompositorFrameSink( |
| 46 widget, std::move(request), binding_.CreateInterfacePtrAndBind()); | 48 widget, std::move(request), binding_.CreateInterfacePtrAndBind(), |
| 49 std::move(display_private_request)); | |
| 47 // TODO(fsamuel): This means we're always requesting a new BeginFrame signal | 50 // TODO(fsamuel): This means we're always requesting a new BeginFrame signal |
| 48 // even when we don't need it. Once surface ID propagation work is done, | 51 // even when we don't need it. Once surface ID propagation work is done, |
| 49 // this will not be necessary because FrameGenerator will only need a | 52 // this will not be necessary because FrameGenerator will only need a |
| 50 // BeginFrame if the window manager changes. | 53 // BeginFrame if the window manager changes. |
| 51 compositor_frame_sink_->SetNeedsBeginFrame(true); | 54 compositor_frame_sink_->SetNeedsBeginFrame(true); |
| 52 } | 55 } |
| 53 | 56 |
| 54 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceId& surface_id, | 57 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 55 ServerWindow* window) { | 58 ServerWindow* window) { |
| 56 DCHECK(surface_id.is_valid()); | 59 DCHECK(surface_id.is_valid()); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 cc::SurfaceId underlay_surface_id = | 343 cc::SurfaceId underlay_surface_id = |
| 341 window->compositor_frame_sink_manager()->GetLatestSurfaceId( | 344 window->compositor_frame_sink_manager()->GetLatestSurfaceId( |
| 342 mojom::CompositorFrameSinkType::UNDERLAY); | 345 mojom::CompositorFrameSinkType::UNDERLAY); |
| 343 if (underlay_surface_id.is_valid()) | 346 if (underlay_surface_id.is_valid()) |
| 344 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); | 347 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); |
| 345 } | 348 } |
| 346 | 349 |
| 347 } // namespace ws | 350 } // namespace ws |
| 348 | 351 |
| 349 } // namespace ui | 352 } // namespace ui |
| OLD | NEW |