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

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

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: address review feedback Created 6 years, 2 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
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 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 12 matching lines...) Expand all
23 #include "cc/base/switches.h" 23 #include "cc/base/switches.h"
24 #include "cc/input/input_handler.h" 24 #include "cc/input/input_handler.h"
25 #include "cc/layers/layer.h" 25 #include "cc/layers/layer.h"
26 #include "cc/output/compositor_frame.h" 26 #include "cc/output/compositor_frame.h"
27 #include "cc/output/context_provider.h" 27 #include "cc/output/context_provider.h"
28 #include "cc/output/output_surface.h" 28 #include "cc/output/output_surface.h"
29 #include "cc/output/output_surface_client.h" 29 #include "cc/output/output_surface_client.h"
30 #include "cc/trees/layer_tree_host.h" 30 #include "cc/trees/layer_tree_host.h"
31 #include "content/browser/android/child_process_launcher_android.h" 31 #include "content/browser/android/child_process_launcher_android.h"
32 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 32 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
33 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
33 #include "content/browser/gpu/gpu_surface_tracker.h" 34 #include "content/browser/gpu/gpu_surface_tracker.h"
34 #include "content/browser/renderer_host/render_widget_host_impl.h" 35 #include "content/browser/renderer_host/render_widget_host_impl.h"
35 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 36 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
36 #include "content/common/gpu/client/context_provider_command_buffer.h" 37 #include "content/common/gpu/client/context_provider_command_buffer.h"
37 #include "content/common/gpu/client/gl_helper.h" 38 #include "content/common/gpu/client/gl_helper.h"
38 #include "content/common/gpu/client/gpu_channel_host.h" 39 #include "content/common/gpu/client/gpu_channel_host.h"
39 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 40 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
40 #include "content/common/gpu/gpu_process_launch_causes.h" 41 #include "content/common/gpu/gpu_process_launch_causes.h"
41 #include "content/common/host_shared_bitmap_manager.h" 42 #include "content/common/host_shared_bitmap_manager.h"
42 #include "content/public/browser/android/compositor_client.h" 43 #include "content/public/browser/android/compositor_client.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); 485 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking));
485 settings.initial_debug_state.show_fps_counter = 486 settings.initial_debug_state.show_fps_counter =
486 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); 487 command_line->HasSwitch(cc::switches::kUIShowFPSCounter);
487 // TODO(enne): Update this this compositor to use the scheduler. 488 // TODO(enne): Update this this compositor to use the scheduler.
488 settings.single_thread_proxy_scheduler = false; 489 settings.single_thread_proxy_scheduler = false;
489 490
490 host_ = cc::LayerTreeHost::CreateSingleThreaded( 491 host_ = cc::LayerTreeHost::CreateSingleThreaded(
491 this, 492 this,
492 this, 493 this,
493 HostSharedBitmapManager::current(), 494 HostSharedBitmapManager::current(),
495 BrowserGpuMemoryBufferManager::current(),
494 settings, 496 settings,
495 base::MessageLoopProxy::current()); 497 base::MessageLoopProxy::current());
496 host_->SetRootLayer(root_layer_); 498 host_->SetRootLayer(root_layer_);
497 499
498 host_->SetVisible(true); 500 host_->SetVisible(true);
499 host_->SetLayerTreeHostClientReady(); 501 host_->SetLayerTreeHostClientReady();
500 host_->SetViewportSize(size_); 502 host_->SetViewportSize(size_);
501 host_->set_has_transparent_background(has_transparent_background_); 503 host_->set_has_transparent_background(has_transparent_background_);
502 host_->SetDeviceScaleFactor(device_scale_factor_); 504 host_->SetDeviceScaleFactor(device_scale_factor_);
503 ui_resource_provider_.SetLayerTreeHost(host_.get()); 505 ui_resource_provider_.SetLayerTreeHost(host_.get());
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 } 714 }
713 715
714 void CompositorImpl::SetNeedsAnimate() { 716 void CompositorImpl::SetNeedsAnimate() {
715 if (!host_) 717 if (!host_)
716 return; 718 return;
717 719
718 host_->SetNeedsAnimate(); 720 host_->SetNeedsAnimate();
719 } 721 }
720 722
721 } // namespace content 723 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698