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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // |surface_factory_|'s resources early on. | 43 // |surface_factory_|'s resources early on. |
44 surface_factory_.DestroyAll(); | 44 surface_factory_.DestroyAll(); |
45 | 45 |
46 if (registered_surface_factory_client_) { | 46 if (registered_surface_factory_client_) { |
47 cc::SurfaceManager* surface_manager = manager_->GetSurfaceManager(); | 47 cc::SurfaceManager* surface_manager = manager_->GetSurfaceManager(); |
48 surface_manager->UnregisterSurfaceFactoryClient(manager_->id_namespace()); | 48 surface_manager->UnregisterSurfaceFactoryClient(manager_->id_namespace()); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 void ServerWindowSurface::SubmitCompositorFrame( | 52 void ServerWindowSurface::SubmitCompositorFrame( |
53 mojom::CompositorFramePtr frame, | 53 cc::mojom::CompositorFramePtr frame, |
54 const SubmitCompositorFrameCallback& callback) { | 54 const SubmitCompositorFrameCallback& callback) { |
55 gfx::Size frame_size = frame->passes[0]->output_rect.size(); | 55 gfx::Size frame_size = frame->passes[0]->output_rect.size(); |
56 if (!surface_id_.is_null()) { | 56 if (!surface_id_.is_null()) { |
57 // If the size of the CompostiorFrame has changed then destroy the existing | 57 // If the size of the CompostiorFrame has changed then destroy the existing |
58 // Surface and create a new one of the appropriate size. | 58 // Surface and create a new one of the appropriate size. |
59 if (frame_size != last_submitted_frame_size_) { | 59 if (frame_size != last_submitted_frame_size_) { |
60 // Rendering of the topmost frame happens in two phases. First the frame | 60 // Rendering of the topmost frame happens in two phases. First the frame |
61 // is generated and submitted, and a later date it is actually drawn. | 61 // is generated and submitted, and a later date it is actually drawn. |
62 // During the time the frame is generated and drawn we can't destroy the | 62 // During the time the frame is generated and drawn we can't destroy the |
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 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); | 102 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); |
103 } | 103 } |
104 | 104 |
105 void ServerWindowSurface::SetBeginFrameSource( | 105 void ServerWindowSurface::SetBeginFrameSource( |
106 cc::BeginFrameSource* begin_frame_source) { | 106 cc::BeginFrameSource* begin_frame_source) { |
107 // TODO(tansell): Implement this. | 107 // TODO(tansell): Implement this. |
108 } | 108 } |
109 | 109 |
110 } // namespace ws | 110 } // namespace ws |
111 } // namespace mus | 111 } // namespace mus |
OLD | NEW |