| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // vsync. | 232 // vsync. |
| 233 composite_on_vsync_trigger_ = COMPOSITE_EVENTUALLY; | 233 composite_on_vsync_trigger_ = COMPOSITE_EVENTUALLY; |
| 234 root_window_->RequestVSyncUpdate(); | 234 root_window_->RequestVSyncUpdate(); |
| 235 DCHECK(WillComposite()); | 235 DCHECK(WillComposite()); |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 | 238 |
| 239 delay = next_composite - now; | 239 delay = next_composite - now; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 TRACE_EVENT2("cc", "CompositorImpl::PostComposite", | 242 TRACE_EVENT2("cc,benchmark", "CompositorImpl::PostComposite", |
| 243 "trigger", trigger, | 243 "trigger", trigger, |
| 244 "delay", delay.InMillisecondsF()); | 244 "delay", delay.InMillisecondsF()); |
| 245 | 245 |
| 246 DCHECK(composite_on_vsync_trigger_ == DO_NOT_COMPOSITE); | 246 DCHECK(composite_on_vsync_trigger_ == DO_NOT_COMPOSITE); |
| 247 if (current_composite_task_) | 247 if (current_composite_task_) |
| 248 current_composite_task_->Cancel(); | 248 current_composite_task_->Cancel(); |
| 249 | 249 |
| 250 // Unretained because we cancel the task on shutdown. | 250 // Unretained because we cancel the task on shutdown. |
| 251 current_composite_task_.reset(new base::CancelableClosure( | 251 current_composite_task_.reset(new base::CancelableClosure( |
| 252 base::Bind(&CompositorImpl::Composite, base::Unretained(this), trigger))); | 252 base::Bind(&CompositorImpl::Composite, base::Unretained(this), trigger))); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 695 |
| 696 void CompositorImpl::SetNeedsAnimate() { | 696 void CompositorImpl::SetNeedsAnimate() { |
| 697 needs_animate_ = true; | 697 needs_animate_ = true; |
| 698 if (!host_) | 698 if (!host_) |
| 699 return; | 699 return; |
| 700 | 700 |
| 701 host_->SetNeedsAnimate(); | 701 host_->SetNeedsAnimate(); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace content | 704 } // namespace content |
| OLD | NEW |