| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/hardware_renderer.h" | 5 #include "android_webview/browser/hardware_renderer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_gl_surface.h" | 9 #include "android_webview/browser/aw_gl_surface.h" |
| 10 #include "android_webview/browser/aw_render_thread_context_provider.h" | 10 #include "android_webview/browser/aw_render_thread_context_provider.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 cc::CompositorFrame frame; | 170 cc::CompositorFrame frame; |
| 171 // We submit without a prior BeginFrame, so acknowledge a manual BeginFrame. | 171 // We submit without a prior BeginFrame, so acknowledge a manual BeginFrame. |
| 172 frame.metadata.begin_frame_ack = | 172 frame.metadata.begin_frame_ack = |
| 173 cc::BeginFrameAck::CreateManualAckWithDamage(); | 173 cc::BeginFrameAck::CreateManualAckWithDamage(); |
| 174 support_->SubmitCompositorFrame(child_id_, std::move(frame)); | 174 support_->SubmitCompositorFrame(child_id_, std::move(frame)); |
| 175 surfaces_->RemoveChildId(cc::SurfaceId(frame_sink_id_, child_id_)); | 175 surfaces_->RemoveChildId(cc::SurfaceId(frame_sink_id_, child_id_)); |
| 176 support_->EvictFrame(); | 176 support_->EvictFrame(); |
| 177 child_id_ = cc::LocalSurfaceId(); | 177 child_id_ = cc::LocalSurfaceId(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void HardwareRenderer::DidReceiveCompositorFrameAck() {} | 180 void HardwareRenderer::DidReceiveCompositorFrameAck( |
| 181 const cc::ReturnedResourceArray& resources) { |
| 182 ReturnResourcesToCompositor(resources, compositor_id_, |
| 183 last_submitted_compositor_frame_sink_id_); |
| 184 } |
| 181 | 185 |
| 182 void HardwareRenderer::OnBeginFrame(const cc::BeginFrameArgs& args) { | 186 void HardwareRenderer::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| 183 // TODO(tansell): Hook this up. | 187 // TODO(tansell): Hook this up. |
| 184 } | 188 } |
| 185 | 189 |
| 186 void HardwareRenderer::ReclaimResources( | 190 void HardwareRenderer::ReclaimResources( |
| 187 const cc::ReturnedResourceArray& resources) { | 191 const cc::ReturnedResourceArray& resources) { |
| 188 ReturnResourcesToCompositor(resources, compositor_id_, | 192 ReturnResourcesToCompositor(resources, compositor_id_, |
| 189 last_submitted_compositor_frame_sink_id_); | 193 last_submitted_compositor_frame_sink_id_); |
| 190 } | 194 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 261 |
| 258 void HardwareRenderer::CreateNewCompositorFrameSinkSupport() { | 262 void HardwareRenderer::CreateNewCompositorFrameSinkSupport() { |
| 259 support_.reset(); | 263 support_.reset(); |
| 260 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 264 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( |
| 261 this, surfaces_->GetSurfaceManager(), frame_sink_id_, false /* is_root */, | 265 this, surfaces_->GetSurfaceManager(), frame_sink_id_, false /* is_root */, |
| 262 false /* handles_frame_sink_id_invalidation */, | 266 false /* handles_frame_sink_id_invalidation */, |
| 263 true /* needs_sync_points */); | 267 true /* needs_sync_points */); |
| 264 } | 268 } |
| 265 | 269 |
| 266 } // namespace android_webview | 270 } // namespace android_webview |
| OLD | NEW |