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 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 cc::LayerTreeHost::InitParams params; | 453 cc::LayerTreeHost::InitParams params; |
454 params.client = this; | 454 params.client = this; |
455 params.shared_bitmap_manager = HostSharedBitmapManager::current(); | 455 params.shared_bitmap_manager = HostSharedBitmapManager::current(); |
456 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); | 456 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); |
457 params.task_graph_runner = g_task_graph_runner.Pointer(); | 457 params.task_graph_runner = g_task_graph_runner.Pointer(); |
458 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 458 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
459 params.settings = &settings; | 459 params.settings = &settings; |
460 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 460 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
461 DCHECK(!host_->visible()); | 461 DCHECK(!host_->visible()); |
462 host_->SetRootLayer(root_layer_); | 462 host_->SetRootLayer(root_layer_); |
| 463 if (surface_id_allocator_) |
| 464 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); |
463 host_->SetViewportSize(size_); | 465 host_->SetViewportSize(size_); |
464 host_->set_has_transparent_background(has_transparent_background_); | 466 host_->set_has_transparent_background(has_transparent_background_); |
465 host_->SetDeviceScaleFactor(device_scale_factor_); | 467 host_->SetDeviceScaleFactor(device_scale_factor_); |
466 | 468 |
467 if (needs_animate_) | 469 if (needs_animate_) |
468 host_->SetNeedsAnimate(); | 470 host_->SetNeedsAnimate(); |
469 } | 471 } |
470 | 472 |
471 void CompositorImpl::SetVisible(bool visible) { | 473 void CompositorImpl::SetVisible(bool visible) { |
472 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); | 474 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 | 797 |
796 void CompositorImpl::SetNeedsAnimate() { | 798 void CompositorImpl::SetNeedsAnimate() { |
797 needs_animate_ = true; | 799 needs_animate_ = true; |
798 if (!host_->visible()) | 800 if (!host_->visible()) |
799 return; | 801 return; |
800 | 802 |
801 host_->SetNeedsAnimate(); | 803 host_->SetNeedsAnimate(); |
802 } | 804 } |
803 | 805 |
804 } // namespace content | 806 } // namespace content |
OLD | NEW |