| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "cc/output/vulkan_in_process_context_provider.h" | 40 #include "cc/output/vulkan_in_process_context_provider.h" |
| 41 #include "cc/raster/single_thread_task_graph_runner.h" | 41 #include "cc/raster/single_thread_task_graph_runner.h" |
| 42 #include "cc/resources/ui_resource_manager.h" | 42 #include "cc/resources/ui_resource_manager.h" |
| 43 #include "cc/scheduler/begin_frame_source.h" | 43 #include "cc/scheduler/begin_frame_source.h" |
| 44 #include "cc/surfaces/display.h" | 44 #include "cc/surfaces/display.h" |
| 45 #include "cc/surfaces/display_scheduler.h" | 45 #include "cc/surfaces/display_scheduler.h" |
| 46 #include "cc/surfaces/surface_display_output_surface.h" | 46 #include "cc/surfaces/surface_display_output_surface.h" |
| 47 #include "cc/surfaces/surface_id_allocator.h" | 47 #include "cc/surfaces/surface_id_allocator.h" |
| 48 #include "cc/trees/layer_tree_host.h" | 48 #include "cc/trees/layer_tree_host.h" |
| 49 #include "cc/trees/layer_tree_settings.h" | 49 #include "cc/trees/layer_tree_settings.h" |
| 50 #include "cc/trees/surface_sequence_generator.h" |
| 50 #include "components/display_compositor/compositor_overlay_candidate_validator_a
ndroid.h" | 51 #include "components/display_compositor/compositor_overlay_candidate_validator_a
ndroid.h" |
| 51 #include "components/display_compositor/gl_helper.h" | 52 #include "components/display_compositor/gl_helper.h" |
| 52 #include "content/browser/android/child_process_launcher_android.h" | 53 #include "content/browser/android/child_process_launcher_android.h" |
| 53 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 54 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 54 #include "content/browser/gpu/compositor_util.h" | 55 #include "content/browser/gpu/compositor_util.h" |
| 55 #include "content/browser/gpu/gpu_surface_tracker.h" | 56 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 56 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | 57 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" |
| 57 #include "content/browser/renderer_host/render_widget_host_impl.h" | 58 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 58 #include "content/common/gpu/client/context_provider_command_buffer.h" | 59 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 59 #include "content/common/host_shared_bitmap_manager.h" | 60 #include "content/common/host_shared_bitmap_manager.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 params.client = this; | 500 params.client = this; |
| 500 params.shared_bitmap_manager = HostSharedBitmapManager::current(); | 501 params.shared_bitmap_manager = HostSharedBitmapManager::current(); |
| 501 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); | 502 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); |
| 502 params.task_graph_runner = g_task_graph_runner.Pointer(); | 503 params.task_graph_runner = g_task_graph_runner.Pointer(); |
| 503 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 504 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 504 params.settings = &settings; | 505 params.settings = &settings; |
| 505 params.animation_host = cc::AnimationHost::CreateMainInstance(); | 506 params.animation_host = cc::AnimationHost::CreateMainInstance(); |
| 506 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 507 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
| 507 DCHECK(!host_->IsVisible()); | 508 DCHECK(!host_->IsVisible()); |
| 508 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer()); | 509 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer()); |
| 509 host_->SetSurfaceClientId(surface_id_allocator_->client_id()); | 510 host_->GetSurfaceSequenceGenerator()->set_surface_client_id( |
| 511 surface_id_allocator_->client_id()); |
| 510 host_->GetLayerTree()->SetViewportSize(size_); | 512 host_->GetLayerTree()->SetViewportSize(size_); |
| 511 host_->GetLayerTree()->set_has_transparent_background( | 513 host_->GetLayerTree()->set_has_transparent_background( |
| 512 has_transparent_background_); | 514 has_transparent_background_); |
| 513 host_->GetLayerTree()->set_background_color(SK_ColorBLACK); | 515 host_->GetLayerTree()->set_background_color(SK_ColorBLACK); |
| 514 host_->GetLayerTree()->SetDeviceScaleFactor(device_scale_factor_); | 516 host_->GetLayerTree()->SetDeviceScaleFactor(device_scale_factor_); |
| 515 | 517 |
| 516 if (needs_animate_) | 518 if (needs_animate_) |
| 517 host_->SetNeedsAnimate(); | 519 host_->SetNeedsAnimate(); |
| 518 } | 520 } |
| 519 | 521 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 | 820 |
| 819 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 821 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
| 820 host_->SetNeedsAnimate(); | 822 host_->SetNeedsAnimate(); |
| 821 } | 823 } |
| 822 | 824 |
| 823 bool CompositorImpl::HavePendingReadbacks() { | 825 bool CompositorImpl::HavePendingReadbacks() { |
| 824 return !readback_layer_tree_->children().empty(); | 826 return !readback_layer_tree_->children().empty(); |
| 825 } | 827 } |
| 826 | 828 |
| 827 } // namespace content | 829 } // namespace content |
| OLD | NEW |