Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 281003002: Make ui::Snapshot asynchronous on Android, remove CompositeAndReadback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pixeltests: syntax Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) { 441 bool CompositorImpl::CompositeAndReadback(void *pixels, const gfx::Rect& rect) {
442 if (host_) 442 return false;
443 return host_->CompositeAndReadback(pixels, rect);
444 else
445 return false;
446 } 443 }
447 444
448 void CompositorImpl::SetNeedsComposite() { 445 void CompositorImpl::SetNeedsComposite() {
449 if (!host_.get() || needs_composite_) 446 if (!host_.get() || needs_composite_)
450 return; 447 return;
451 448
452 needs_composite_ = true; 449 needs_composite_ = true;
453 450
454 // For explicit requests we try to composite regularly on vsync. 451 // For explicit requests we try to composite regularly on vsync.
455 should_composite_on_vsync_ = true; 452 should_composite_on_vsync_ = true;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 } 613 }
617 614
618 void CompositorImpl::DidCommit() { 615 void CompositorImpl::DidCommit() {
619 root_window_->OnCompositingDidCommit(); 616 root_window_->OnCompositingDidCommit();
620 } 617 }
621 618
622 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { 619 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) {
623 root_layer_->AddChild(layer); 620 root_layer_->AddChild(layer);
624 } 621 }
625 622
623 void CompositorImpl::RequestCopyOfOutputOnRootLayer(
624 scoped_ptr<cc::CopyOutputRequest> request) {
625 root_layer_->RequestCopyOfOutput(request.Pass());
626 }
627
626 void CompositorImpl::OnVSync(base::TimeTicks frame_time, 628 void CompositorImpl::OnVSync(base::TimeTicks frame_time,
627 base::TimeDelta vsync_period) { 629 base::TimeDelta vsync_period) {
628 vsync_period_ = vsync_period; 630 vsync_period_ = vsync_period;
629 did_composite_this_frame_ = false; 631 did_composite_this_frame_ = false;
630 632
631 if (should_composite_on_vsync_) 633 if (should_composite_on_vsync_)
632 Composite(COMPOSITE_ON_VSYNC); 634 Composite(COMPOSITE_ON_VSYNC);
633 } 635 }
634 636
635 } // namespace content 637 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698