Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2650303002: cc: Remove the LayerTreeHost abstraction. (Closed)
Patch Set: missed ui Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 #include "cc/output/output_surface.h" 36 #include "cc/output/output_surface.h"
37 #include "cc/output/output_surface_client.h" 37 #include "cc/output/output_surface_client.h"
38 #include "cc/output/output_surface_frame.h" 38 #include "cc/output/output_surface_frame.h"
39 #include "cc/output/texture_mailbox_deleter.h" 39 #include "cc/output/texture_mailbox_deleter.h"
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/surfaces/direct_compositor_frame_sink.h" 43 #include "cc/surfaces/direct_compositor_frame_sink.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/trees/layer_tree_host_in_process.h" 46 #include "cc/trees/layer_tree_host.h"
47 #include "cc/trees/layer_tree_settings.h" 47 #include "cc/trees/layer_tree_settings.h"
48 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h" 48 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h"
49 #include "components/display_compositor/gl_helper.h" 49 #include "components/display_compositor/gl_helper.h"
50 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 50 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
51 #include "content/browser/gpu/compositor_util.h" 51 #include "content/browser/gpu/compositor_util.h"
52 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" 52 #include "content/browser/renderer_host/context_provider_factory_impl_android.h"
53 #include "content/browser/renderer_host/render_widget_host_impl.h" 53 #include "content/browser/renderer_host/render_widget_host_impl.h"
54 #include "content/common/host_shared_bitmap_manager.h" 54 #include "content/common/host_shared_bitmap_manager.h"
55 #include "content/public/browser/android/compositor.h" 55 #include "content/public/browser/android/compositor.h"
56 #include "content/public/browser/android/compositor_client.h" 56 #include "content/public/browser/android/compositor_client.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 429 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
430 settings.initial_debug_state.SetRecordRenderingStats( 430 settings.initial_debug_state.SetRecordRenderingStats(
431 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); 431 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking));
432 settings.initial_debug_state.show_fps_counter = 432 settings.initial_debug_state.show_fps_counter =
433 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); 433 command_line->HasSwitch(cc::switches::kUIShowFPSCounter);
434 settings.single_thread_proxy_scheduler = true; 434 settings.single_thread_proxy_scheduler = true;
435 435
436 animation_host_ = cc::AnimationHost::CreateMainInstance(); 436 animation_host_ = cc::AnimationHost::CreateMainInstance();
437 437
438 cc::LayerTreeHostInProcess::InitParams params; 438 cc::LayerTreeHost::InitParams params;
439 params.client = this; 439 params.client = this;
440 params.task_graph_runner = g_task_graph_runner.Pointer(); 440 params.task_graph_runner = g_task_graph_runner.Pointer();
441 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); 441 params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
442 params.settings = &settings; 442 params.settings = &settings;
443 params.mutator_host = animation_host_.get(); 443 params.mutator_host = animation_host_.get();
444 host_ = cc::LayerTreeHostInProcess::CreateSingleThreaded(this, &params); 444 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
445 DCHECK(!host_->IsVisible()); 445 DCHECK(!host_->IsVisible());
446 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer()); 446 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer());
447 host_->SetFrameSinkId(frame_sink_id_); 447 host_->SetFrameSinkId(frame_sink_id_);
448 host_->GetLayerTree()->SetViewportSize(size_); 448 host_->GetLayerTree()->SetViewportSize(size_);
449 SetHasTransparentBackground(false); 449 SetHasTransparentBackground(false);
450 host_->GetLayerTree()->SetDeviceScaleFactor(1); 450 host_->GetLayerTree()->SetDeviceScaleFactor(1);
451 451
452 if (needs_animate_) 452 if (needs_animate_)
453 host_->SetNeedsAnimate(); 453 host_->SetNeedsAnimate();
454 } 454 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 733
734 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { 734 cc::FrameSinkId CompositorImpl::GetFrameSinkId() {
735 return frame_sink_id_; 735 return frame_sink_id_;
736 } 736 }
737 737
738 bool CompositorImpl::HavePendingReadbacks() { 738 bool CompositorImpl::HavePendingReadbacks() {
739 return !readback_layer_tree_->children().empty(); 739 return !readback_layer_tree_->children().empty();
740 } 740 }
741 741
742 } // namespace content 742 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698