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 <unordered_set> | 10 #include <unordered_set> |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 502 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
503 params.settings = &settings; | 503 params.settings = &settings; |
504 params.animation_host = cc::AnimationHost::CreateMainInstance(); | 504 params.animation_host = cc::AnimationHost::CreateMainInstance(); |
505 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 505 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
506 DCHECK(!host_->visible()); | 506 DCHECK(!host_->visible()); |
507 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer()); | 507 host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer()); |
508 host_->set_surface_client_id(surface_id_allocator_->client_id()); | 508 host_->set_surface_client_id(surface_id_allocator_->client_id()); |
509 host_->GetLayerTree()->SetViewportSize(size_); | 509 host_->GetLayerTree()->SetViewportSize(size_); |
510 host_->GetLayerTree()->set_has_transparent_background( | 510 host_->GetLayerTree()->set_has_transparent_background( |
511 has_transparent_background_); | 511 has_transparent_background_); |
| 512 host_->GetLayerTree()->set_background_color(SK_ColorBLACK); |
512 host_->GetLayerTree()->SetDeviceScaleFactor(device_scale_factor_); | 513 host_->GetLayerTree()->SetDeviceScaleFactor(device_scale_factor_); |
513 | 514 |
514 if (needs_animate_) | 515 if (needs_animate_) |
515 host_->SetNeedsAnimate(); | 516 host_->SetNeedsAnimate(); |
516 } | 517 } |
517 | 518 |
518 void CompositorImpl::SetVisible(bool visible) { | 519 void CompositorImpl::SetVisible(bool visible) { |
519 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); | 520 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); |
520 if (!visible) { | 521 if (!visible) { |
521 DCHECK(host_->visible()); | 522 DCHECK(host_->visible()); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 | 816 |
816 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 817 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
817 host_->SetNeedsAnimate(); | 818 host_->SetNeedsAnimate(); |
818 } | 819 } |
819 | 820 |
820 bool CompositorImpl::HavePendingReadbacks() { | 821 bool CompositorImpl::HavePendingReadbacks() { |
821 return !readback_layer_tree_->children().empty(); | 822 return !readback_layer_tree_->children().empty(); |
822 } | 823 } |
823 | 824 |
824 } // namespace content | 825 } // namespace content |
OLD | NEW |