| 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 "services/ui/ws/server_window_surface.h" | 5 #include "services/ui/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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // this we schedule destruction via the delegate. The delegate will call | 57 // this we schedule destruction via the delegate. The delegate will call |
| 58 // us back when we're not waiting on a frame to be drawn (which may be | 58 // us back when we're not waiting on a frame to be drawn (which may be |
| 59 // synchronously). | 59 // synchronously). |
| 60 if (!surface_id_.is_null()) { | 60 if (!surface_id_.is_null()) { |
| 61 surfaces_scheduled_for_destruction_.insert(surface_id_); | 61 surfaces_scheduled_for_destruction_.insert(surface_id_); |
| 62 window()->delegate()->ScheduleSurfaceDestruction(window()); | 62 window()->delegate()->ScheduleSurfaceDestruction(window()); |
| 63 } | 63 } |
| 64 surface_id_ = surface_id_allocator_.GenerateId(); | 64 surface_id_ = surface_id_allocator_.GenerateId(); |
| 65 surface_factory_.Create(surface_id_); | 65 surface_factory_.Create(surface_id_); |
| 66 } | 66 } |
| 67 may_contain_video_ = frame.metadata.may_contain_video; |
| 67 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame), | 68 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame), |
| 68 callback); | 69 callback); |
| 69 last_submitted_frame_size_ = frame_size; | 70 last_submitted_frame_size_ = frame_size; |
| 70 window()->delegate()->OnScheduleWindowPaint(window()); | 71 window()->delegate()->OnScheduleWindowPaint(window()); |
| 71 } | 72 } |
| 72 | 73 |
| 73 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() { | 74 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() { |
| 74 std::set<cc::SurfaceId> surfaces; | 75 std::set<cc::SurfaceId> surfaces; |
| 75 surfaces.swap(surfaces_scheduled_for_destruction_); | 76 surfaces.swap(surfaces_scheduled_for_destruction_); |
| 76 for (auto& id : surfaces) | 77 for (auto& id : surfaces) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 88 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); | 89 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void ServerWindowSurface::SetBeginFrameSource( | 92 void ServerWindowSurface::SetBeginFrameSource( |
| 92 cc::BeginFrameSource* begin_frame_source) { | 93 cc::BeginFrameSource* begin_frame_source) { |
| 93 // TODO(tansell): Implement this. | 94 // TODO(tansell): Implement this. |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace ws | 97 } // namespace ws |
| 97 } // namespace ui | 98 } // namespace ui |
| OLD | NEW |