| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 DCHECK(root_window); | 253 DCHECK(root_window); |
| 254 root_window->AttachCompositor(this); | 254 root_window->AttachCompositor(this); |
| 255 CreateLayerTreeHost(); | 255 CreateLayerTreeHost(); |
| 256 resource_manager_.Init(host_.get()); | 256 resource_manager_.Init(host_.get()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 CompositorImpl::~CompositorImpl() { | 259 CompositorImpl::~CompositorImpl() { |
| 260 root_window_->DetachCompositor(); | 260 root_window_->DetachCompositor(); |
| 261 // Clean-up any surface references. | 261 // Clean-up any surface references. |
| 262 SetSurface(NULL); | 262 SetSurface(NULL); |
| 263 | |
| 264 // Explicitly tear down everything cc-related before destroying |this|. | |
| 265 host_.reset(); | |
| 266 } | 263 } |
| 267 | 264 |
| 268 void CompositorImpl::PostComposite(CompositingTrigger trigger) { | 265 void CompositorImpl::PostComposite(CompositingTrigger trigger) { |
| 269 DCHECK(host_->visible()); | 266 DCHECK(host_->visible()); |
| 270 DCHECK(needs_composite_); | 267 DCHECK(needs_composite_); |
| 271 DCHECK(trigger == COMPOSITE_IMMEDIATELY || trigger == COMPOSITE_EVENTUALLY); | 268 DCHECK(trigger == COMPOSITE_IMMEDIATELY || trigger == COMPOSITE_EVENTUALLY); |
| 272 | 269 |
| 273 if (will_composite_immediately_ || | 270 if (will_composite_immediately_ || |
| 274 (trigger == COMPOSITE_EVENTUALLY && WillComposite())) { | 271 (trigger == COMPOSITE_EVENTUALLY && WillComposite())) { |
| 275 // We will already composite soon enough. | 272 // We will already composite soon enough. |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 | 800 |
| 804 void CompositorImpl::SetNeedsAnimate() { | 801 void CompositorImpl::SetNeedsAnimate() { |
| 805 needs_animate_ = true; | 802 needs_animate_ = true; |
| 806 if (!host_->visible()) | 803 if (!host_->visible()) |
| 807 return; | 804 return; |
| 808 | 805 |
| 809 host_->SetNeedsAnimate(); | 806 host_->SetNeedsAnimate(); |
| 810 } | 807 } |
| 811 | 808 |
| 812 } // namespace content | 809 } // namespace content |
| OLD | NEW |