| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 host_->SetViewportSize(size); | 431 host_->SetViewportSize(size); |
| 432 root_layer_->SetBounds(size); | 432 root_layer_->SetBounds(size); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void CompositorImpl::SetHasTransparentBackground(bool flag) { | 435 void CompositorImpl::SetHasTransparentBackground(bool flag) { |
| 436 has_transparent_background_ = flag; | 436 has_transparent_background_ = flag; |
| 437 if (host_) | 437 if (host_) |
| 438 host_->set_has_transparent_background(flag); | 438 host_->set_has_transparent_background(flag); |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool CompositorImpl::CompositeAndReadback(void *pixels, const gfx::Rect& rect) { | |
| 442 return false; | |
| 443 } | |
| 444 | |
| 445 void CompositorImpl::SetNeedsComposite() { | 441 void CompositorImpl::SetNeedsComposite() { |
| 446 if (!host_.get() || needs_composite_) | 442 if (!host_.get() || needs_composite_) |
| 447 return; | 443 return; |
| 448 | 444 |
| 449 needs_composite_ = true; | 445 needs_composite_ = true; |
| 450 | 446 |
| 451 // For explicit requests we try to composite regularly on vsync. | 447 // For explicit requests we try to composite regularly on vsync. |
| 452 should_composite_on_vsync_ = true; | 448 should_composite_on_vsync_ = true; |
| 453 root_window_->RequestVSyncUpdate(); | 449 root_window_->RequestVSyncUpdate(); |
| 454 } | 450 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 void CompositorImpl::OnVSync(base::TimeTicks frame_time, | 624 void CompositorImpl::OnVSync(base::TimeTicks frame_time, |
| 629 base::TimeDelta vsync_period) { | 625 base::TimeDelta vsync_period) { |
| 630 vsync_period_ = vsync_period; | 626 vsync_period_ = vsync_period; |
| 631 did_composite_this_frame_ = false; | 627 did_composite_this_frame_ = false; |
| 632 | 628 |
| 633 if (should_composite_on_vsync_) | 629 if (should_composite_on_vsync_) |
| 634 Composite(COMPOSITE_ON_VSYNC); | 630 Composite(COMPOSITE_ON_VSYNC); |
| 635 } | 631 } |
| 636 | 632 |
| 637 } // namespace content | 633 } // namespace content |
| OLD | NEW |