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

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

Issue 2648583005: [wip] hack to use synthetic bfs for browser compositor (Closed)
Patch Set: Created 3 years, 11 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
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 #include <stdint.h> 9 #include <stdint.h>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 508 }
509 509
510 void CompositorImpl::SetNeedsComposite() { 510 void CompositorImpl::SetNeedsComposite() {
511 if (!host_->IsVisible()) 511 if (!host_->IsVisible())
512 return; 512 return;
513 TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite"); 513 TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite");
514 host_->SetNeedsAnimate(); 514 host_->SetNeedsAnimate();
515 } 515 }
516 516
517 void CompositorImpl::UpdateLayerTreeHost() { 517 void CompositorImpl::UpdateLayerTreeHost() {
518 TRACE_EVENT0("cc", "CompositorImpl::UpdateLayerTreeHost");
518 client_->UpdateLayerTreeHost(); 519 client_->UpdateLayerTreeHost();
519 if (needs_animate_) { 520 if (needs_animate_) {
520 needs_animate_ = false; 521 needs_animate_ = false;
521 root_window_->Animate(base::TimeTicks::Now()); 522 root_window_->Animate(base::TimeTicks::Now());
522 } 523 }
523 } 524 }
524 525
525 void CompositorImpl::RequestNewCompositorFrameSink() { 526 void CompositorImpl::RequestNewCompositorFrameSink() {
526 DCHECK(!compositor_frame_sink_request_pending_) 527 DCHECK(!compositor_frame_sink_request_pending_)
527 << "Output Surface Request is already pending?"; 528 << "Output Surface Request is already pending?";
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 pending_swapbuffers_--; 704 pending_swapbuffers_--;
704 client_->OnSwapBuffersCompleted(pending_swapbuffers_); 705 client_->OnSwapBuffersCompleted(pending_swapbuffers_);
705 } 706 }
706 707
707 void CompositorImpl::DidLoseCompositorFrameSink() { 708 void CompositorImpl::DidLoseCompositorFrameSink() {
708 TRACE_EVENT0("compositor", "CompositorImpl::DidLoseCompositorFrameSink"); 709 TRACE_EVENT0("compositor", "CompositorImpl::DidLoseCompositorFrameSink");
709 client_->OnSwapBuffersCompleted(0); 710 client_->OnSwapBuffersCompleted(0);
710 } 711 }
711 712
712 void CompositorImpl::DidCommit() { 713 void CompositorImpl::DidCommit() {
714 TRACE_EVENT0("cc", "CompositorImpl::DidCommit");
713 root_window_->OnCompositingDidCommit(); 715 root_window_->OnCompositingDidCommit();
714 } 716 }
715 717
716 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { 718 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) {
717 readback_layer_tree_->AddChild(layer); 719 readback_layer_tree_->AddChild(layer);
718 } 720 }
719 721
720 void CompositorImpl::RequestCopyOfOutputOnRootLayer( 722 void CompositorImpl::RequestCopyOfOutputOnRootLayer(
721 std::unique_ptr<cc::CopyOutputRequest> request) { 723 std::unique_ptr<cc::CopyOutputRequest> request) {
722 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request)); 724 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request));
(...skipping 10 matching lines...) Expand all
733 735
734 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { 736 cc::FrameSinkId CompositorImpl::GetFrameSinkId() {
735 return frame_sink_id_; 737 return frame_sink_id_;
736 } 738 }
737 739
738 bool CompositorImpl::HavePendingReadbacks() { 740 bool CompositorImpl::HavePendingReadbacks() {
739 return !readback_layer_tree_->children().empty(); 741 return !readback_layer_tree_->children().empty();
740 } 742 }
741 743
742 } // namespace content 744 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698