Commit cc108652 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Enable shared images by default on Android

Bug: 900973
Change-Id: I67570ec7f0fcf7daa9bd1234d17ae5a9c9b9bf23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761634Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688744}
parent 99a8e52f
...@@ -116,7 +116,8 @@ bool TestLayerTreeFrameSink::BindToClient(LayerTreeFrameSinkClient* client) { ...@@ -116,7 +116,8 @@ bool TestLayerTreeFrameSink::BindToClient(LayerTreeFrameSinkClient* client) {
frame_sink_manager_->RegisterBeginFrameSource(display_begin_frame_source_, frame_sink_manager_->RegisterBeginFrameSource(display_begin_frame_source_,
frame_sink_id_); frame_sink_id_);
} }
display_->Initialize(this, frame_sink_manager_->surface_manager()); display_->Initialize(this, frame_sink_manager_->surface_manager(),
true /* enable_shared_images */);
display_->renderer_for_testing()->SetEnlargePassTextureAmountForTesting( display_->renderer_for_testing()->SetEnlargePassTextureAmountForTesting(
enlarge_pass_texture_amount_); enlarge_pass_texture_amount_);
display_->SetColorSpace(output_color_space_); display_->SetColorSpace(output_color_space_);
......
...@@ -90,16 +90,9 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, ...@@ -90,16 +90,9 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient,
base::TimeDelta::FromMilliseconds(50); base::TimeDelta::FromMilliseconds(50);
static constexpr uint32_t kDrawToSwapUsBuckets = 50; static constexpr uint32_t kDrawToSwapUsBuckets = 50;
// TODO(cblume, crbug.com/900973): |enable_shared_images| is a temporary
// solution that unblocks us until SharedImages are threadsafe in WebView.
#if defined(ANDROID)
static constexpr bool kEnableSharedImages = false;
#else
static constexpr bool kEnableSharedImages = true;
#endif
void Initialize(DisplayClient* client, void Initialize(DisplayClient* client,
SurfaceManager* surface_manager, SurfaceManager* surface_manager,
bool enable_shared_images = kEnableSharedImages); bool enable_shared_images);
void AddObserver(DisplayObserver* observer); void AddObserver(DisplayObserver* observer);
void RemoveObserver(DisplayObserver* observer); void RemoveObserver(DisplayObserver* observer);
......
...@@ -266,7 +266,8 @@ class RendererPerfTest : public testing::Test { ...@@ -266,7 +266,8 @@ class RendererPerfTest : public testing::Test {
std::move(output_surface), std::move(output_surface),
/*display_scheduler=*/nullptr, base::ThreadTaskRunnerHandle::Get()); /*display_scheduler=*/nullptr, base::ThreadTaskRunnerHandle::Get());
display_->SetVisible(true); display_->SetVisible(true);
display_->Initialize(&client_, manager_.surface_manager()); display_->Initialize(&client_, manager_.surface_manager(),
true /* enable_shared_images */);
display_->Resize(kSurfaceSize); display_->Resize(kSurfaceSize);
id_allocator_.GenerateId(); id_allocator_.GenerateId();
......
...@@ -110,7 +110,8 @@ bool DirectLayerTreeFrameSink::BindToClient( ...@@ -110,7 +110,8 @@ bool DirectLayerTreeFrameSink::BindToClient(
// Avoid initializing GL context here, as this should be sharing the // Avoid initializing GL context here, as this should be sharing the
// Display's context. // Display's context.
display_->Initialize(this, frame_sink_manager_->surface_manager()); display_->Initialize(this, frame_sink_manager_->surface_manager(),
true /* enable_shared_images */);
support_->SetUpHitTest(display_); support_->SetUpHitTest(display_);
......
...@@ -314,7 +314,8 @@ RootCompositorFrameSinkImpl::RootCompositorFrameSinkImpl( ...@@ -314,7 +314,8 @@ RootCompositorFrameSinkImpl::RootCompositorFrameSinkImpl(
DCHECK(begin_frame_source()); DCHECK(begin_frame_source());
frame_sink_manager->RegisterBeginFrameSource(begin_frame_source(), frame_sink_manager->RegisterBeginFrameSource(begin_frame_source(),
support_->frame_sink_id()); support_->frame_sink_id());
display_->Initialize(this, support_->frame_sink_manager()->surface_manager()); display_->Initialize(this, support_->frame_sink_manager()->surface_manager(),
true /* enable_shared_images */);
support_->SetUpHitTest(display_.get()); support_->SetUpHitTest(display_.get());
} }
......
...@@ -227,8 +227,8 @@ bool SynchronousLayerTreeFrameSink::BindToClient( ...@@ -227,8 +227,8 @@ bool SynchronousLayerTreeFrameSink::BindToClient(
&shared_bitmap_manager_, software_renderer_settings, kRootFrameSinkId, &shared_bitmap_manager_, software_renderer_settings, kRootFrameSinkId,
std::move(output_surface), nullptr /* scheduler */, std::move(output_surface), nullptr /* scheduler */,
nullptr /* current_task_runner */); nullptr /* current_task_runner */);
display_->Initialize(&display_client_, display_->Initialize(&display_client_, frame_sink_manager_->surface_manager(),
frame_sink_manager_->surface_manager()); true /* enable_shared_images */);
display_->SetVisible(true); display_->SetVisible(true);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment