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);
......
...@@ -236,7 +236,7 @@ TEST_F(DisplayTest, DisplayDamaged) { ...@@ -236,7 +236,7 @@ TEST_F(DisplayTest, DisplayDamaged) {
gfx::ColorSpace color_space_2 = gfx::ColorSpace::CreateSCRGBLinear(); gfx::ColorSpace color_space_2 = gfx::ColorSpace::CreateSCRGBLinear();
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetColorSpace(color_space_1); display_->SetColorSpace(color_space_1);
EXPECT_FALSE(scheduler_->damaged); EXPECT_FALSE(scheduler_->damaged);
...@@ -528,7 +528,7 @@ void DisplayTest::LatencyInfoCapTest(bool over_capacity) { ...@@ -528,7 +528,7 @@ void DisplayTest::LatencyInfoCapTest(bool over_capacity) {
SetUpSoftwareDisplay(RendererSettings()); SetUpSoftwareDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
id_allocator_.GenerateId(); id_allocator_.GenerateId();
LocalSurfaceId local_surface_id( LocalSurfaceId local_surface_id(
...@@ -610,7 +610,7 @@ TEST_F(DisplayTest, DisableSwapUntilResize) { ...@@ -610,7 +610,7 @@ TEST_F(DisplayTest, DisableSwapUntilResize) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId(local_surface_id1, 1.f); display_->SetLocalSurfaceId(local_surface_id1, 1.f);
...@@ -687,7 +687,7 @@ TEST_F(DisplayTest, ContextLossInformsClient) { ...@@ -687,7 +687,7 @@ TEST_F(DisplayTest, ContextLossInformsClient) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
CountLossDisplayClient client; CountLossDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// Verify DidLoseOutputSurface callback is hooked up correctly. // Verify DidLoseOutputSurface callback is hooked up correctly.
EXPECT_EQ(0, client.loss_count()); EXPECT_EQ(0, client.loss_count());
...@@ -710,7 +710,7 @@ TEST_F(DisplayTest, CompositorFrameDamagesCorrectDisplay) { ...@@ -710,7 +710,7 @@ TEST_F(DisplayTest, CompositorFrameDamagesCorrectDisplay) {
// Set up first display. // Set up first display.
SetUpSoftwareDisplay(settings); SetUpSoftwareDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId(local_surface_id, 1.f); display_->SetLocalSurfaceId(local_surface_id, 1.f);
// Set up second frame sink + display. // Set up second frame sink + display.
...@@ -728,7 +728,7 @@ TEST_F(DisplayTest, CompositorFrameDamagesCorrectDisplay) { ...@@ -728,7 +728,7 @@ TEST_F(DisplayTest, CompositorFrameDamagesCorrectDisplay) {
manager_.RegisterBeginFrameSource(begin_frame_source2.get(), manager_.RegisterBeginFrameSource(begin_frame_source2.get(),
kAnotherFrameSinkId); kAnotherFrameSinkId);
StubDisplayClient client2; StubDisplayClient client2;
display2->Initialize(&client2, manager_.surface_manager()); display2->Initialize(&client2, manager_.surface_manager(), true);
display2->SetLocalSurfaceId(local_surface_id, 1.f); display2->SetLocalSurfaceId(local_surface_id, 1.f);
display_->Resize(gfx::Size(100, 100)); display_->Resize(gfx::Size(100, 100));
...@@ -762,7 +762,7 @@ TEST_F(DisplayTest, DrawOcclusionWithNonCoveringDrawQuad) { ...@@ -762,7 +762,7 @@ TEST_F(DisplayTest, DrawOcclusionWithNonCoveringDrawQuad) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -983,7 +983,7 @@ TEST_F(DisplayTest, CompositorFrameWithOverlapDrawQuad) { ...@@ -983,7 +983,7 @@ TEST_F(DisplayTest, CompositorFrameWithOverlapDrawQuad) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -1114,7 +1114,7 @@ TEST_F(DisplayTest, DrawOcclusionWithSkipRect) { ...@@ -1114,7 +1114,7 @@ TEST_F(DisplayTest, DrawOcclusionWithSkipRect) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect more_then_minimum_size( gfx::Rect more_then_minimum_size(
...@@ -1239,7 +1239,7 @@ TEST_F(DisplayTest, OcclusionIgnoringSkipRect) { ...@@ -1239,7 +1239,7 @@ TEST_F(DisplayTest, OcclusionIgnoringSkipRect) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 50, 50); gfx::Rect rect1(0, 0, 50, 50);
...@@ -1301,7 +1301,7 @@ TEST_F(DisplayTest, CompositorFrameWithTransformer) { ...@@ -1301,7 +1301,7 @@ TEST_F(DisplayTest, CompositorFrameWithTransformer) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// Rect 2, 3, 4 are contained in rect 1 only after applying the half scale // Rect 2, 3, 4 are contained in rect 1 only after applying the half scale
// matrix. They are repetition of CompositorFrameWithOverlapDrawQuad. // matrix. They are repetition of CompositorFrameWithOverlapDrawQuad.
...@@ -1572,7 +1572,7 @@ TEST_F(DisplayTest, CompositorFrameWithEpsilonScaleTransform) { ...@@ -1572,7 +1572,7 @@ TEST_F(DisplayTest, CompositorFrameWithEpsilonScaleTransform) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect(0, 0, 100, 100); gfx::Rect rect(0, 0, 100, 100);
...@@ -1684,7 +1684,7 @@ TEST_F(DisplayTest, CompositorFrameWithNegativeScaleTransform) { ...@@ -1684,7 +1684,7 @@ TEST_F(DisplayTest, CompositorFrameWithNegativeScaleTransform) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect(0, 0, 100, 100); gfx::Rect rect(0, 0, 100, 100);
...@@ -1808,7 +1808,7 @@ TEST_F(DisplayTest, CompositorFrameWithRotation) { ...@@ -1808,7 +1808,7 @@ TEST_F(DisplayTest, CompositorFrameWithRotation) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 2 is inside rect 1 initially. // rect 2 is inside rect 1 initially.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -1937,7 +1937,7 @@ TEST_F(DisplayTest, CompositorFrameWithPerspective) { ...@@ -1937,7 +1937,7 @@ TEST_F(DisplayTest, CompositorFrameWithPerspective) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 2 is inside rect 1 initially. // rect 2 is inside rect 1 initially.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -2013,7 +2013,7 @@ TEST_F(DisplayTest, CompositorFrameWithOpacityChange) { ...@@ -2013,7 +2013,7 @@ TEST_F(DisplayTest, CompositorFrameWithOpacityChange) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2080,7 +2080,7 @@ TEST_F(DisplayTest, CompositorFrameWithOpaquenessChange) { ...@@ -2080,7 +2080,7 @@ TEST_F(DisplayTest, CompositorFrameWithOpaquenessChange) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2148,7 +2148,7 @@ TEST_F(DisplayTest, CompositorFrameZTranslate) { ...@@ -2148,7 +2148,7 @@ TEST_F(DisplayTest, CompositorFrameZTranslate) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2203,7 +2203,7 @@ TEST_F(DisplayTest, CompositorFrameWithTranslateTransformer) { ...@@ -2203,7 +2203,7 @@ TEST_F(DisplayTest, CompositorFrameWithTranslateTransformer) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 2 and 3 are outside rect 1 initially. // rect 2 and 3 are outside rect 1 initially.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -2324,7 +2324,7 @@ TEST_F(DisplayTest, CompositorFrameWithCombinedSharedQuadState) { ...@@ -2324,7 +2324,7 @@ TEST_F(DisplayTest, CompositorFrameWithCombinedSharedQuadState) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 3 is inside of combined rect of rect 1 and rect 2. // rect 3 is inside of combined rect of rect 1 and rect 2.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -2452,7 +2452,7 @@ TEST_F(DisplayTest, CompositorFrameWithMultipleRenderPass) { ...@@ -2452,7 +2452,7 @@ TEST_F(DisplayTest, CompositorFrameWithMultipleRenderPass) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 3 is inside of combined rect of rect 1 and rect 2. // rect 3 is inside of combined rect of rect 1 and rect 2.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -2526,7 +2526,7 @@ TEST_F(DisplayTest, CompositorFrameWithCoveredRenderPass) { ...@@ -2526,7 +2526,7 @@ TEST_F(DisplayTest, CompositorFrameWithCoveredRenderPass) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// rect 3 is inside of combined rect of rect 1 and rect 2. // rect 3 is inside of combined rect of rect 1 and rect 2.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -2597,7 +2597,7 @@ TEST_F(DisplayTest, CompositorFrameWithClip) { ...@@ -2597,7 +2597,7 @@ TEST_F(DisplayTest, CompositorFrameWithClip) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2714,7 +2714,7 @@ TEST_F(DisplayTest, CompositorFrameWithCopyRequest) { ...@@ -2714,7 +2714,7 @@ TEST_F(DisplayTest, CompositorFrameWithCopyRequest) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2762,7 +2762,7 @@ TEST_F(DisplayTest, CompositorFrameWithRenderPass) { ...@@ -2762,7 +2762,7 @@ TEST_F(DisplayTest, CompositorFrameWithRenderPass) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -2942,7 +2942,7 @@ TEST_F(DisplayTest, CompositorFrameWithMultipleDrawQuadInSharedQuadState) { ...@@ -2942,7 +2942,7 @@ TEST_F(DisplayTest, CompositorFrameWithMultipleDrawQuadInSharedQuadState) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
...@@ -3120,7 +3120,7 @@ TEST_F(DisplayTest, CompositorFrameWithNonInvertibleTransform) { ...@@ -3120,7 +3120,7 @@ TEST_F(DisplayTest, CompositorFrameWithNonInvertibleTransform) {
SetUpGpuDisplay(settings); SetUpGpuDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect1(0, 0, 100, 100);
gfx::Rect rect2(10, 10, 50, 50); gfx::Rect rect2(10, 10, 50, 50);
...@@ -3223,7 +3223,7 @@ TEST_F(DisplayTest, DrawOcclusionWithLargeDrawQuad) { ...@@ -3223,7 +3223,7 @@ TEST_F(DisplayTest, DrawOcclusionWithLargeDrawQuad) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
// The size of this DrawQuad will be 237790x237790 > 2^32 (uint32_t.max()) // The size of this DrawQuad will be 237790x237790 > 2^32 (uint32_t.max())
...@@ -3269,7 +3269,7 @@ TEST_F(DisplayTest, CompositorFrameWithPresentationToken) { ...@@ -3269,7 +3269,7 @@ TEST_F(DisplayTest, CompositorFrameWithPresentationToken) {
// Set up first display. // Set up first display.
SetUpSoftwareDisplay(settings); SetUpSoftwareDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId(local_surface_id, 1.f); display_->SetLocalSurfaceId(local_surface_id, 1.f);
// Create frame sink for a sub surface. // Create frame sink for a sub surface.
...@@ -3380,7 +3380,7 @@ TEST_F(DisplayTest, BeginFrameThrottling) { ...@@ -3380,7 +3380,7 @@ TEST_F(DisplayTest, BeginFrameThrottling) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId( display_->SetLocalSurfaceId(
id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(), id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(),
1.f); 1.f);
...@@ -3457,7 +3457,7 @@ TEST_F(DisplayTest, BeginFrameThrottlingMultipleSurfaces) { ...@@ -3457,7 +3457,7 @@ TEST_F(DisplayTest, BeginFrameThrottlingMultipleSurfaces) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId( display_->SetLocalSurfaceId(
id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(), id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(),
1.f); 1.f);
...@@ -3534,7 +3534,7 @@ TEST_F(DisplayTest, DontThrottleWhenParentBlocked) { ...@@ -3534,7 +3534,7 @@ TEST_F(DisplayTest, DontThrottleWhenParentBlocked) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId( display_->SetLocalSurfaceId(
id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(), id_allocator_.GetCurrentLocalSurfaceIdAllocation().local_surface_id(),
1.f); 1.f);
...@@ -3624,7 +3624,7 @@ TEST_F(DisplayTest, InvalidPresentationTimestamps) { ...@@ -3624,7 +3624,7 @@ TEST_F(DisplayTest, InvalidPresentationTimestamps) {
// Set up first display. // Set up first display.
SetUpSoftwareDisplay(settings); SetUpSoftwareDisplay(settings);
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
display_->SetLocalSurfaceId(local_surface_id, 1.f); display_->SetLocalSurfaceId(local_surface_id, 1.f);
display_->Resize(gfx::Size(25, 25)); display_->Resize(gfx::Size(25, 25));
...@@ -3698,7 +3698,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerDoesNotOcclude) { ...@@ -3698,7 +3698,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerDoesNotOcclude) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -3755,7 +3755,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerDoesOcclude) { ...@@ -3755,7 +3755,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerDoesOcclude) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// The quad with rounded corner completely covers the quad below it. // The quad with rounded corner completely covers the quad below it.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
...@@ -3810,7 +3810,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerPartialOcclude) { ...@@ -3810,7 +3810,7 @@ TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerPartialOcclude) {
SetUpGpuDisplay(RendererSettings()); SetUpGpuDisplay(RendererSettings());
StubDisplayClient client; StubDisplayClient client;
display_->Initialize(&client, manager_.surface_manager()); display_->Initialize(&client, manager_.surface_manager(), true);
// The quad with rounded corner completely covers the quad below it. // The quad with rounded corner completely covers the quad below it.
CompositorFrame frame = MakeDefaultCompositorFrame(); CompositorFrame frame = MakeDefaultCompositorFrame();
......
...@@ -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