| 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 "base/containers/adapters.h" | 7 #include "base/containers/adapters.h" |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
| 10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // TODO(kylechar): Adding surface references should be synchronized with | 92 // TODO(kylechar): Adding surface references should be synchronized with |
| 93 // SubmitCompositorFrame(). | 93 // SubmitCompositorFrame(). |
| 94 | 94 |
| 95 auto iter = active_references_.find(surface_id.frame_sink_id()); | 95 auto iter = active_references_.find(surface_id.frame_sink_id()); |
| 96 if (iter == active_references_.end()) { | 96 if (iter == active_references_.end()) { |
| 97 AddFirstReference(surface_id, window); | 97 AddFirstReference(surface_id, window); |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 | 100 |
| 101 SurfaceReference& ref = iter->second; | 101 SurfaceReference& ref = iter->second; |
| 102 DCHECK(surface_id.frame_sink_id() == ref.child_id.frame_sink_id()); | 102 DCHECK_EQ(surface_id.frame_sink_id(), ref.child_id.frame_sink_id()); |
| 103 | 103 |
| 104 // This shouldn't be called multiple times for the same SurfaceId. | 104 // This shouldn't be called multiple times for the same SurfaceId. |
| 105 DCHECK(surface_id.local_frame_id() != ref.child_id.local_frame_id()); | 105 DCHECK_NE(surface_id.local_frame_id(), ref.child_id.local_frame_id()); |
| 106 | 106 |
| 107 // Add a reference from parent to new surface first. | 107 // Add a reference from parent to new surface first. |
| 108 GetDisplayCompositor()->AddSurfaceReference(ref.parent_id, surface_id); | 108 GetDisplayCompositor()->AddSurfaceReference(ref.parent_id, surface_id); |
| 109 | 109 |
| 110 // If the display root surface has changed, update all references to embedded | 110 // If the display root surface has changed, update all references to embedded |
| 111 // surfaces. For example, this would happen when the display resolution or | 111 // surfaces. For example, this would happen when the display resolution or |
| 112 // zoom level changes. | 112 // zoom level changes. |
| 113 if (!window->parent()) | 113 if (!window->parent()) |
| 114 AddNewParentReferences(ref.child_id, surface_id); | 114 AddNewParentReferences(ref.child_id, surface_id); |
| 115 | 115 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 cc::SurfaceId underlay_surface_id = | 374 cc::SurfaceId underlay_surface_id = |
| 375 window->compositor_frame_sink_manager()->GetLatestSurfaceId( | 375 window->compositor_frame_sink_manager()->GetLatestSurfaceId( |
| 376 mojom::CompositorFrameSinkType::UNDERLAY); | 376 mojom::CompositorFrameSinkType::UNDERLAY); |
| 377 if (underlay_surface_id.is_valid()) | 377 if (underlay_surface_id.is_valid()) |
| 378 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); | 378 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); |
| 379 } | 379 } |
| 380 | 380 |
| 381 } // namespace ws | 381 } // namespace ws |
| 382 | 382 |
| 383 } // namespace ui | 383 } // namespace ui |
| OLD | NEW |