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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 settings.use_compositor_animation_timelines = true; | 466 settings.use_compositor_animation_timelines = true; |
467 | 467 |
468 cc::LayerTreeHost::InitParams params; | 468 cc::LayerTreeHost::InitParams params; |
469 params.client = this; | 469 params.client = this; |
470 params.shared_bitmap_manager = HostSharedBitmapManager::current(); | 470 params.shared_bitmap_manager = HostSharedBitmapManager::current(); |
471 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); | 471 params.gpu_memory_buffer_manager = BrowserGpuMemoryBufferManager::current(); |
472 params.task_graph_runner = g_task_graph_runner.Pointer(); | 472 params.task_graph_runner = g_task_graph_runner.Pointer(); |
473 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 473 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
474 params.settings = &settings; | 474 params.settings = &settings; |
475 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 475 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
476 host_->SetVisible(false); | 476 DCHECK(!host_->visible()); |
477 host_->SetRootLayer(root_layer_); | 477 host_->SetRootLayer(root_layer_); |
478 host_->SetLayerTreeHostClientReady(); | |
479 host_->SetViewportSize(size_); | 478 host_->SetViewportSize(size_); |
480 host_->set_has_transparent_background(has_transparent_background_); | 479 host_->set_has_transparent_background(has_transparent_background_); |
481 host_->SetDeviceScaleFactor(device_scale_factor_); | 480 host_->SetDeviceScaleFactor(device_scale_factor_); |
482 | 481 |
483 if (needs_animate_) | 482 if (needs_animate_) |
484 host_->SetNeedsAnimate(); | 483 host_->SetNeedsAnimate(); |
485 } | 484 } |
486 | 485 |
487 void CompositorImpl::SetVisible(bool visible) { | 486 void CompositorImpl::SetVisible(bool visible) { |
488 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); | 487 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 810 |
812 void CompositorImpl::SetNeedsAnimate() { | 811 void CompositorImpl::SetNeedsAnimate() { |
813 needs_animate_ = true; | 812 needs_animate_ = true; |
814 if (!host_->visible()) | 813 if (!host_->visible()) |
815 return; | 814 return; |
816 | 815 |
817 host_->SetNeedsAnimate(); | 816 host_->SetNeedsAnimate(); |
818 } | 817 } |
819 | 818 |
820 } // namespace content | 819 } // namespace content |
OLD | NEW |