| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/android/synchronous_compositor_frame_sink.h" | 5 #include "content/renderer/android/synchronous_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return false; | 161 return false; |
| 162 | 162 |
| 163 DCHECK(begin_frame_source_); | 163 DCHECK(begin_frame_source_); |
| 164 client_->SetBeginFrameSource(begin_frame_source_.get()); | 164 client_->SetBeginFrameSource(begin_frame_source_.get()); |
| 165 client_->SetMemoryPolicy(memory_policy_); | 165 client_->SetMemoryPolicy(memory_policy_); |
| 166 client_->SetTreeActivationCallback( | 166 client_->SetTreeActivationCallback( |
| 167 base::Bind(&SynchronousCompositorFrameSink::DidActivatePendingTree, | 167 base::Bind(&SynchronousCompositorFrameSink::DidActivatePendingTree, |
| 168 base::Unretained(this))); | 168 base::Unretained(this))); |
| 169 registry_->RegisterCompositorFrameSink(routing_id_, this); | 169 registry_->RegisterCompositorFrameSink(routing_id_, this); |
| 170 | 170 |
| 171 constexpr bool root_support_is_root = true; |
| 172 constexpr bool child_support_is_root = false; |
| 173 constexpr bool handles_frame_sink_id_invalidation = true; |
| 174 constexpr bool needs_sync_points = true; |
| 171 root_support_.reset(new cc::CompositorFrameSinkSupport( | 175 root_support_.reset(new cc::CompositorFrameSinkSupport( |
| 172 this, surface_manager_.get(), kRootFrameSinkId, | 176 this, surface_manager_.get(), kRootFrameSinkId, root_support_is_root, |
| 173 true /* submits_to_display_compositor */)); | 177 handles_frame_sink_id_invalidation, needs_sync_points)); |
| 174 child_support_.reset(new cc::CompositorFrameSinkSupport( | 178 child_support_.reset(new cc::CompositorFrameSinkSupport( |
| 175 this, surface_manager_.get(), kChildFrameSinkId, | 179 this, surface_manager_.get(), kChildFrameSinkId, child_support_is_root, |
| 176 false /* submits_to_display_compositor */)); | 180 handles_frame_sink_id_invalidation, needs_sync_points)); |
| 177 | 181 |
| 178 cc::RendererSettings software_renderer_settings; | 182 cc::RendererSettings software_renderer_settings; |
| 179 | 183 |
| 180 auto output_surface = base::MakeUnique<SoftwareOutputSurface>( | 184 auto output_surface = base::MakeUnique<SoftwareOutputSurface>( |
| 181 base::MakeUnique<SoftwareDevice>(¤t_sw_canvas_)); | 185 base::MakeUnique<SoftwareDevice>(¤t_sw_canvas_)); |
| 182 software_output_surface_ = output_surface.get(); | 186 software_output_surface_ = output_surface.get(); |
| 183 | 187 |
| 184 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as | 188 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as |
| 185 // this Display is only used for resourcesless software draws, where no | 189 // this Display is only used for resourcesless software draws, where no |
| 186 // resources are included in the frame swapped from the compositor. So there | 190 // resources are included in the frame swapped from the compositor. So there |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 462 |
| 459 void SynchronousCompositorFrameSink::ReclaimResources( | 463 void SynchronousCompositorFrameSink::ReclaimResources( |
| 460 const cc::ReturnedResourceArray& resources) { | 464 const cc::ReturnedResourceArray& resources) { |
| 461 DCHECK(resources.empty()); | 465 DCHECK(resources.empty()); |
| 462 client_->ReclaimResources(resources); | 466 client_->ReclaimResources(resources); |
| 463 } | 467 } |
| 464 | 468 |
| 465 void SynchronousCompositorFrameSink::WillDrawSurface() {} | 469 void SynchronousCompositorFrameSink::WillDrawSurface() {} |
| 466 | 470 |
| 467 } // namespace content | 471 } // namespace content |
| OLD | NEW |