OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/ws/server_window_surface.h" | 5 #include "components/mus/ws/server_window_surface.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/quads/shared_quad_state.h" | 9 #include "cc/quads/shared_quad_state.h" |
10 #include "cc/quads/surface_draw_quad.h" | 10 #include "cc/quads/surface_draw_quad.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // surface, otherwise when drawn you get an empty surface. To deal with | 63 // surface, otherwise when drawn you get an empty surface. To deal with |
64 // this we schedule destruction via the delegate. The delegate will call | 64 // this we schedule destruction via the delegate. The delegate will call |
65 // us back when we're not waiting on a frame to be drawn (which may be | 65 // us back when we're not waiting on a frame to be drawn (which may be |
66 // synchronously). | 66 // synchronously). |
67 surfaces_scheduled_for_destruction_.insert(surface_id_); | 67 surfaces_scheduled_for_destruction_.insert(surface_id_); |
68 window()->delegate()->ScheduleSurfaceDestruction(window()); | 68 window()->delegate()->ScheduleSurfaceDestruction(window()); |
69 surface_id_ = manager_->GenerateId(); | 69 surface_id_ = manager_->GenerateId(); |
70 surface_factory_.Create(surface_id_); | 70 surface_factory_.Create(surface_id_); |
71 } | 71 } |
72 } | 72 } |
73 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame), | 73 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); |
| 74 *frame_copy = std::move(frame); |
| 75 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame_copy), |
74 base::Bind(&CallCallback, callback)); | 76 base::Bind(&CallCallback, callback)); |
75 last_submitted_frame_size_ = frame_size; | 77 last_submitted_frame_size_ = frame_size; |
76 window()->delegate()->OnScheduleWindowPaint(window()); | 78 window()->delegate()->OnScheduleWindowPaint(window()); |
77 } | 79 } |
78 | 80 |
79 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() { | 81 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() { |
80 std::set<cc::SurfaceId> surfaces; | 82 std::set<cc::SurfaceId> surfaces; |
81 surfaces.swap(surfaces_scheduled_for_destruction_); | 83 surfaces.swap(surfaces_scheduled_for_destruction_); |
82 for (auto& id : surfaces) | 84 for (auto& id : surfaces) |
83 surface_factory_.Destroy(id); | 85 surface_factory_.Destroy(id); |
(...skipping 17 matching lines...) Expand all Loading... |
101 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); | 103 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); |
102 } | 104 } |
103 | 105 |
104 void ServerWindowSurface::SetBeginFrameSource( | 106 void ServerWindowSurface::SetBeginFrameSource( |
105 cc::BeginFrameSource* begin_frame_source) { | 107 cc::BeginFrameSource* begin_frame_source) { |
106 // TODO(tansell): Implement this. | 108 // TODO(tansell): Implement this. |
107 } | 109 } |
108 | 110 |
109 } // namespace ws | 111 } // namespace ws |
110 } // namespace mus | 112 } // namespace mus |
OLD | NEW |