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

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

Issue 2565783002: Moves ownership of the cc::Display's BeginFrameSource out of Display. (Closed)
Patch Set: rebase. Created 4 years 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 if (context_provider) { 720 if (context_provider) {
721 gpu_capabilities_ = context_provider->ContextCapabilities(); 721 gpu_capabilities_ = context_provider->ContextCapabilities();
722 } else { 722 } else {
723 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider. 723 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider.
724 } 724 }
725 725
726 cc::SurfaceManager* manager = 726 cc::SurfaceManager* manager =
727 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager(); 727 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager();
728 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get(); 728 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get();
729 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source( 729 begin_frame_source_.reset(new ExternalBeginFrameSource(this));
730 new ExternalBeginFrameSource(this));
731 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 730 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
732 begin_frame_source.get(), task_runner, 731 task_runner, display_output_surface->capabilities().max_frames_pending));
733 display_output_surface->capabilities().max_frames_pending));
734 732
735 display_.reset(new cc::Display( 733 display_.reset(new cc::Display(
736 HostSharedBitmapManager::current(), 734 HostSharedBitmapManager::current(),
737 BrowserGpuMemoryBufferManager::current(), 735 BrowserGpuMemoryBufferManager::current(),
738 host_->GetSettings().renderer_settings, frame_sink_id_, 736 host_->GetSettings().renderer_settings, frame_sink_id_,
739 std::move(begin_frame_source), std::move(display_output_surface), 737 begin_frame_source_.get(), std::move(display_output_surface),
740 std::move(scheduler), 738 std::move(scheduler),
741 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner))); 739 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner)));
742 740
743 auto compositor_frame_sink = 741 auto compositor_frame_sink =
744 vulkan_context_provider 742 vulkan_context_provider
745 ? base::MakeUnique<cc::DirectCompositorFrameSink>( 743 ? base::MakeUnique<cc::DirectCompositorFrameSink>(
746 frame_sink_id_, manager, display_.get(), 744 frame_sink_id_, manager, display_.get(),
747 vulkan_context_provider) 745 vulkan_context_provider)
748 : base::MakeUnique<cc::DirectCompositorFrameSink>( 746 : base::MakeUnique<cc::DirectCompositorFrameSink>(
749 frame_sink_id_, manager, display_.get(), context_provider, 747 frame_sink_id_, manager, display_.get(), context_provider,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 834
837 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { 835 cc::FrameSinkId CompositorImpl::GetFrameSinkId() {
838 return frame_sink_id_; 836 return frame_sink_id_;
839 } 837 }
840 838
841 bool CompositorImpl::HavePendingReadbacks() { 839 bool CompositorImpl::HavePendingReadbacks() {
842 return !readback_layer_tree_->children().empty(); 840 return !readback_layer_tree_->children().empty();
843 } 841 }
844 842
845 } // namespace content 843 } // 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