| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 host_->SetLayerTreeHostClientReady(); | 429 host_->SetLayerTreeHostClientReady(); |
| 430 host_->SetViewportSize(size_); | 430 host_->SetViewportSize(size_); |
| 431 host_->set_has_transparent_background(has_transparent_background_); | 431 host_->set_has_transparent_background(has_transparent_background_); |
| 432 host_->SetDeviceScaleFactor(device_scale_factor_); | 432 host_->SetDeviceScaleFactor(device_scale_factor_); |
| 433 | 433 |
| 434 if (needs_animate_) | 434 if (needs_animate_) |
| 435 host_->SetNeedsAnimate(); | 435 host_->SetNeedsAnimate(); |
| 436 } | 436 } |
| 437 | 437 |
| 438 void CompositorImpl::SetVisible(bool visible) { | 438 void CompositorImpl::SetVisible(bool visible) { |
| 439 TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible); |
| 439 if (!visible) { | 440 if (!visible) { |
| 440 DCHECK(host_); | 441 DCHECK(host_); |
| 441 // Look for any layers that were attached to the root for readback | 442 // Look for any layers that were attached to the root for readback |
| 442 // and are waiting for Composite() to happen. | 443 // and are waiting for Composite() to happen. |
| 443 bool readback_pending = false; | 444 bool readback_pending = false; |
| 444 for (size_t i = 0; i < root_layer_->children().size(); ++i) { | 445 for (size_t i = 0; i < root_layer_->children().size(); ++i) { |
| 445 if (root_layer_->children()[i]->HasCopyRequest()) { | 446 if (root_layer_->children()[i]->HasCopyRequest()) { |
| 446 readback_pending = true; | 447 readback_pending = true; |
| 447 break; | 448 break; |
| 448 } | 449 } |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 | 720 |
| 720 void CompositorImpl::SetNeedsAnimate() { | 721 void CompositorImpl::SetNeedsAnimate() { |
| 721 needs_animate_ = true; | 722 needs_animate_ = true; |
| 722 if (!host_) | 723 if (!host_) |
| 723 return; | 724 return; |
| 724 | 725 |
| 725 host_->SetNeedsAnimate(); | 726 host_->SetNeedsAnimate(); |
| 726 } | 727 } |
| 727 | 728 |
| 728 } // namespace content | 729 } // namespace content |
| OLD | NEW |