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 <utility> | 10 #include <utility> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
24 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
25 #include "base/thread_task_runner_handle.h" | 25 #include "base/thread_task_runner_handle.h" |
26 #include "base/threading/simple_thread.h" | 26 #include "base/threading/simple_thread.h" |
27 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
28 #include "base/threading/thread_checker.h" | 28 #include "base/threading/thread_checker.h" |
29 #include "cc/base/switches.h" | 29 #include "cc/base/switches.h" |
30 #include "cc/input/input_handler.h" | 30 #include "cc/input/input_handler.h" |
31 #include "cc/layers/layer.h" | 31 #include "cc/layers/layer.h" |
32 #include "cc/layers/layer_settings.h" | |
33 #include "cc/output/compositor_frame.h" | 32 #include "cc/output/compositor_frame.h" |
34 #include "cc/output/context_provider.h" | 33 #include "cc/output/context_provider.h" |
35 #include "cc/output/output_surface.h" | 34 #include "cc/output/output_surface.h" |
36 #include "cc/output/output_surface_client.h" | 35 #include "cc/output/output_surface_client.h" |
37 #include "cc/raster/single_thread_task_graph_runner.h" | 36 #include "cc/raster/single_thread_task_graph_runner.h" |
38 #include "cc/scheduler/begin_frame_source.h" | 37 #include "cc/scheduler/begin_frame_source.h" |
39 #include "cc/surfaces/onscreen_display_client.h" | 38 #include "cc/surfaces/onscreen_display_client.h" |
40 #include "cc/surfaces/surface_display_output_surface.h" | 39 #include "cc/surfaces/surface_display_output_surface.h" |
41 #include "cc/surfaces/surface_id_allocator.h" | 40 #include "cc/surfaces/surface_id_allocator.h" |
42 #include "cc/surfaces/surface_manager.h" | 41 #include "cc/surfaces/surface_manager.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 scoped_ptr<cc::SurfaceIdAllocator> allocator( | 235 scoped_ptr<cc::SurfaceIdAllocator> allocator( |
237 new cc::SurfaceIdAllocator(++g_surface_id_namespace)); | 236 new cc::SurfaceIdAllocator(++g_surface_id_namespace)); |
238 cc::SurfaceManager* manager = GetSurfaceManager(); | 237 cc::SurfaceManager* manager = GetSurfaceManager(); |
239 DCHECK(manager); | 238 DCHECK(manager); |
240 allocator->RegisterSurfaceIdNamespace(manager); | 239 allocator->RegisterSurfaceIdNamespace(manager); |
241 return allocator; | 240 return allocator; |
242 } | 241 } |
243 | 242 |
244 CompositorImpl::CompositorImpl(CompositorClient* client, | 243 CompositorImpl::CompositorImpl(CompositorClient* client, |
245 gfx::NativeWindow root_window) | 244 gfx::NativeWindow root_window) |
246 : root_layer_(cc::Layer::Create(cc::LayerSettings())), | 245 : root_layer_(cc::Layer::Create()), |
247 resource_manager_(root_window), | 246 resource_manager_(root_window), |
248 surface_id_allocator_(CreateSurfaceIdAllocator()), | 247 surface_id_allocator_(CreateSurfaceIdAllocator()), |
249 has_transparent_background_(false), | 248 has_transparent_background_(false), |
250 device_scale_factor_(1), | 249 device_scale_factor_(1), |
251 window_(NULL), | 250 window_(NULL), |
252 surface_id_(0), | 251 surface_id_(0), |
253 client_(client), | 252 client_(client), |
254 root_window_(root_window), | 253 root_window_(root_window), |
255 needs_animate_(false), | 254 needs_animate_(false), |
256 pending_swapbuffers_(0U), | 255 pending_swapbuffers_(0U), |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 627 |
629 void CompositorImpl::SetNeedsAnimate() { | 628 void CompositorImpl::SetNeedsAnimate() { |
630 needs_animate_ = true; | 629 needs_animate_ = true; |
631 if (!host_->visible()) | 630 if (!host_->visible()) |
632 return; | 631 return; |
633 | 632 |
634 host_->SetNeedsAnimate(); | 633 host_->SetNeedsAnimate(); |
635 } | 634 } |
636 | 635 |
637 } // namespace content | 636 } // namespace content |
OLD | NEW |