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 "ui/android/delegated_frame_host_android.h" | 5 #include "ui/android/delegated_frame_host_android.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { | 122 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { |
123 if (!surface_info_.is_valid()) | 123 if (!surface_info_.is_valid()) |
124 return; | 124 return; |
125 | 125 |
126 DCHECK(content_layer_); | 126 DCHECK(content_layer_); |
127 | 127 |
128 content_layer_->RemoveFromParent(); | 128 content_layer_->RemoveFromParent(); |
129 content_layer_ = nullptr; | 129 content_layer_ = nullptr; |
130 support_->EvictFrame(); | 130 support_->EvictCurrentSurface(); |
131 surface_info_ = cc::SurfaceInfo(); | 131 surface_info_ = cc::SurfaceInfo(); |
132 } | 132 } |
133 | 133 |
134 bool DelegatedFrameHostAndroid::HasDelegatedContent() const { | 134 bool DelegatedFrameHostAndroid::HasDelegatedContent() const { |
135 return surface_info_.is_valid(); | 135 return surface_info_.is_valid(); |
136 } | 136 } |
137 | 137 |
138 void DelegatedFrameHostAndroid::CompositorFrameSinkChanged() { | 138 void DelegatedFrameHostAndroid::CompositorFrameSinkChanged() { |
139 DestroyDelegatedContent(); | 139 DestroyDelegatedContent(); |
140 CreateNewCompositorFrameSinkSupport(); | 140 CreateNewCompositorFrameSinkSupport(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 support_ = cc::CompositorFrameSinkSupport::Create( | 197 support_ = cc::CompositorFrameSinkSupport::Create( |
198 this, surface_manager_, frame_sink_id_, is_root, | 198 this, surface_manager_, frame_sink_id_, is_root, |
199 handles_frame_sink_id_invalidation, needs_sync_points); | 199 handles_frame_sink_id_invalidation, needs_sync_points); |
200 } | 200 } |
201 | 201 |
202 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { | 202 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { |
203 return surface_info_.id(); | 203 return surface_info_.id(); |
204 } | 204 } |
205 | 205 |
206 } // namespace ui | 206 } // namespace ui |
OLD | NEW |