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

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

Issue 2243663002: Android: Attach hidden layer for CopyFromCompositingSurface() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // context was lost. 743 // context was lost.
744 if (host_->visible()) 744 if (host_->visible())
745 host_->SetNeedsCommit(); 745 host_->SetNeedsCommit();
746 client_->OnSwapBuffersCompleted(0); 746 client_->OnSwapBuffersCompleted(0);
747 } 747 }
748 748
749 void CompositorImpl::DidCommit() { 749 void CompositorImpl::DidCommit() {
750 root_window_->OnCompositingDidCommit(); 750 root_window_->OnCompositingDidCommit();
751 } 751 }
752 752
753 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) {
754 root_window_->GetLayer()->AddChild(layer);
755 }
756
753 void CompositorImpl::RequestCopyOfOutputOnRootLayer( 757 void CompositorImpl::RequestCopyOfOutputOnRootLayer(
754 std::unique_ptr<cc::CopyOutputRequest> request) { 758 std::unique_ptr<cc::CopyOutputRequest> request) {
755 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request)); 759 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request));
756 } 760 }
757 761
758 void CompositorImpl::OnVSync(base::TimeTicks frame_time, 762 void CompositorImpl::OnVSync(base::TimeTicks frame_time,
759 base::TimeDelta vsync_period) { 763 base::TimeDelta vsync_period) {
760 FOR_EACH_OBSERVER(VSyncObserver, observer_list_, 764 FOR_EACH_OBSERVER(VSyncObserver, observer_list_,
761 OnVSync(frame_time, vsync_period)); 765 OnVSync(frame_time, vsync_period));
762 if (needs_begin_frames_) 766 if (needs_begin_frames_)
(...skipping 12 matching lines...) Expand all
775 void CompositorImpl::SetNeedsAnimate() { 779 void CompositorImpl::SetNeedsAnimate() {
776 needs_animate_ = true; 780 needs_animate_ = true;
777 if (!host_->visible()) 781 if (!host_->visible())
778 return; 782 return;
779 783
780 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); 784 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
781 host_->SetNeedsAnimate(); 785 host_->SetNeedsAnimate();
782 } 786 }
783 787
784 } // namespace content 788 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698