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 "android_webview/browser/surfaces_instance.h" | 5 #include "android_webview/browser/surfaces_instance.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "android_webview/browser/aw_gl_surface.h" | 10 #include "android_webview/browser/aw_gl_surface.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 void SurfacesInstance::SetEmptyRootFrame() { | 169 void SurfacesInstance::SetEmptyRootFrame() { |
170 cc::CompositorFrame empty_frame; | 170 cc::CompositorFrame empty_frame; |
171 // We draw synchronously, so acknowledge a manual BeginFrame. | 171 // We draw synchronously, so acknowledge a manual BeginFrame. |
172 empty_frame.metadata.begin_frame_ack = | 172 empty_frame.metadata.begin_frame_ack = |
173 cc::BeginFrameAck::CreateManualAckWithDamage(); | 173 cc::BeginFrameAck::CreateManualAckWithDamage(); |
174 empty_frame.metadata.referenced_surfaces = child_ids_; | 174 empty_frame.metadata.referenced_surfaces = child_ids_; |
175 support_->SubmitCompositorFrame(root_id_, std::move(empty_frame)); | 175 support_->SubmitCompositorFrame(root_id_, std::move(empty_frame)); |
176 } | 176 } |
177 | 177 |
178 void SurfacesInstance::DidReceiveCompositorFrameAck() {} | 178 void SurfacesInstance::DidReceiveCompositorFrameAck( |
| 179 const cc::ReturnedResourceArray& resources) { |
| 180 ReclaimResources(resources); |
| 181 } |
179 | 182 |
180 void SurfacesInstance::OnBeginFrame(const cc::BeginFrameArgs& args) {} | 183 void SurfacesInstance::OnBeginFrame(const cc::BeginFrameArgs& args) {} |
181 | 184 |
182 void SurfacesInstance::WillDrawSurface( | 185 void SurfacesInstance::WillDrawSurface( |
183 const cc::LocalSurfaceId& local_surface_id, | 186 const cc::LocalSurfaceId& local_surface_id, |
184 const gfx::Rect& damage_rect) {} | 187 const gfx::Rect& damage_rect) {} |
185 | 188 |
186 void SurfacesInstance::ReclaimResources( | 189 void SurfacesInstance::ReclaimResources( |
187 const cc::ReturnedResourceArray& resources) { | 190 const cc::ReturnedResourceArray& resources) { |
188 // Root surface should have no resources to return. | 191 // Root surface should have no resources to return. |
189 CHECK(resources.empty()); | 192 CHECK(resources.empty()); |
190 } | 193 } |
191 | 194 |
192 } // namespace android_webview | 195 } // namespace android_webview |
OLD | NEW |