| 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_output_surface.h" | 5 #include "content/renderer/android/synchronous_compositor_output_surface.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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 surface_manager_->RegisterSurfaceFactoryClient( | 146 surface_manager_->RegisterSurfaceFactoryClient( |
| 147 surface_id_allocator_->client_id(), this); | 147 surface_id_allocator_->client_id(), this); |
| 148 | 148 |
| 149 cc::RendererSettings software_renderer_settings; | 149 cc::RendererSettings software_renderer_settings; |
| 150 | 150 |
| 151 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as | 151 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as |
| 152 // this Display is only used for resourcesless software draws, where no | 152 // this Display is only used for resourcesless software draws, where no |
| 153 // resources are included in the frame swapped from the compositor. So there | 153 // resources are included in the frame swapped from the compositor. So there |
| 154 // is no need for these. | 154 // is no need for these. |
| 155 display_.reset(new cc::Display( | 155 display_.reset(new cc::Display( |
| 156 surface_manager_.get(), nullptr /* shared_bitmap_manager */, | 156 nullptr /* shared_bitmap_manager */, |
| 157 nullptr /* gpu_memory_buffer_manager */, software_renderer_settings, | 157 nullptr /* gpu_memory_buffer_manager */, software_renderer_settings, |
| 158 surface_id_allocator_->client_id(), nullptr /* begin_frame_source */, | 158 nullptr /* begin_frame_source */, |
| 159 base::MakeUnique<SoftwareOutputSurface>( | 159 base::MakeUnique<SoftwareOutputSurface>( |
| 160 base::MakeUnique<SoftwareDevice>(¤t_sw_canvas_)), | 160 base::MakeUnique<SoftwareDevice>(¤t_sw_canvas_)), |
| 161 nullptr /* scheduler */, nullptr /* texture_mailbox_deleter */)); | 161 nullptr /* scheduler */, nullptr /* texture_mailbox_deleter */)); |
| 162 display_->Initialize(&display_client_); | 162 display_->Initialize(&display_client_, surface_manager_.get(), |
| 163 surface_id_allocator_->client_id()); |
| 163 return true; | 164 return true; |
| 164 } | 165 } |
| 165 | 166 |
| 166 void SynchronousCompositorOutputSurface::DetachFromClient() { | 167 void SynchronousCompositorOutputSurface::DetachFromClient() { |
| 167 DCHECK(CalledOnValidThread()); | 168 DCHECK(CalledOnValidThread()); |
| 168 if (registered_) { | 169 if (registered_) { |
| 169 registry_->UnregisterOutputSurface(routing_id_, this); | 170 registry_->UnregisterOutputSurface(routing_id_, this); |
| 170 } | 171 } |
| 171 client_->SetTreeActivationCallback(base::Closure()); | 172 client_->SetTreeActivationCallback(base::Closure()); |
| 172 if (!delegated_surface_id_.is_null()) | 173 if (!delegated_surface_id_.is_null()) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 client_->ReclaimResources(&ack); | 404 client_->ReclaimResources(&ack); |
| 404 } | 405 } |
| 405 | 406 |
| 406 void SynchronousCompositorOutputSurface::SetBeginFrameSource( | 407 void SynchronousCompositorOutputSurface::SetBeginFrameSource( |
| 407 cc::BeginFrameSource* begin_frame_source) { | 408 cc::BeginFrameSource* begin_frame_source) { |
| 408 // Software output is synchronous and doesn't use a BeginFrameSource. | 409 // Software output is synchronous and doesn't use a BeginFrameSource. |
| 409 NOTREACHED(); | 410 NOTREACHED(); |
| 410 } | 411 } |
| 411 | 412 |
| 412 } // namespace content | 413 } // namespace content |
| OLD | NEW |