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

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

Issue 2304483002: Revert of Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Created 4 years, 3 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 std::unique_ptr<cc::OutputSurface> display_output_surface, 675 std::unique_ptr<cc::OutputSurface> display_output_surface,
676 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, 676 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
677 scoped_refptr<cc::ContextProvider> context_provider) { 677 scoped_refptr<cc::ContextProvider> context_provider) {
678 DCHECK(output_surface_request_pending_); 678 DCHECK(output_surface_request_pending_);
679 679
680 pending_swapbuffers_ = 0; 680 pending_swapbuffers_ = 0;
681 681
682 cc::SurfaceManager* manager = 682 cc::SurfaceManager* manager =
683 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager(); 683 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager();
684 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get(); 684 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get();
685 auto begin_frame_source = base::MakeUnique<ExternalBeginFrameSource>(this); 685 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source(
686 new ExternalBeginFrameSource(this));
686 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 687 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
687 begin_frame_source.get(), task_runner, 688 begin_frame_source.get(), task_runner,
688 display_output_surface->capabilities().max_frames_pending)); 689 display_output_surface->capabilities().max_frames_pending));
689 690
690 display_.reset(new cc::Display( 691 display_.reset(new cc::Display(
691 HostSharedBitmapManager::current(), 692 HostSharedBitmapManager::current(),
692 BrowserGpuMemoryBufferManager::current(), 693 BrowserGpuMemoryBufferManager::current(),
693 host_->settings().renderer_settings, begin_frame_source.get(), 694 host_->settings().renderer_settings, std::move(begin_frame_source),
694 std::move(display_output_surface), std::move(scheduler), 695 std::move(display_output_surface), std::move(scheduler),
695 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner))); 696 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner)));
696 begin_frame_source_ = std::move(begin_frame_source);
697 697
698 std::unique_ptr<cc::SurfaceDisplayOutputSurface> delegated_output_surface( 698 std::unique_ptr<cc::SurfaceDisplayOutputSurface> delegated_output_surface(
699 vulkan_context_provider ? new cc::SurfaceDisplayOutputSurface( 699 vulkan_context_provider ? new cc::SurfaceDisplayOutputSurface(
700 manager, surface_id_allocator_.get(), 700 manager, surface_id_allocator_.get(),
701 display_.get(), vulkan_context_provider) 701 display_.get(), vulkan_context_provider)
702 : new cc::SurfaceDisplayOutputSurface( 702 : new cc::SurfaceDisplayOutputSurface(
703 manager, surface_id_allocator_.get(), 703 manager, surface_id_allocator_.get(),
704 display_.get(), context_provider, nullptr)); 704 display_.get(), context_provider, nullptr));
705 705
706 display_->SetVisible(true); 706 display_->SetVisible(true);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); 796 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
797 host_->SetNeedsAnimate(); 797 host_->SetNeedsAnimate();
798 } 798 }
799 799
800 bool CompositorImpl::HavePendingReadbacks() { 800 bool CompositorImpl::HavePendingReadbacks() {
801 return !readback_layer_tree_->children().empty(); 801 return !readback_layer_tree_->children().empty();
802 } 802 }
803 803
804 } // namespace content 804 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | services/ui/surfaces/display_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698