Skip to content

Commit

Permalink
Add GrSurfaceOrigin and SkAlphaType to SharedImageInterface
Browse files Browse the repository at this point in the history
Right now shared images make assumptions about the surface origin and
alpha type of each image. This CL is a no op but follow up CLs will
handle the piping on the service side and actually use it when creating
shared images.

Bug: 1034086
Change-Id: I7b16cc9f986bca71b245aaaff92337c2e92ac75a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2280228
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Nathan Zabriskie <nazabris@microsoft.com>
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#788904}
  • Loading branch information
NathanZabriskie authored and Commit Bot committed Jul 16, 2020
1 parent 2299d44 commit 659c274
Show file tree
Hide file tree
Showing 56 changed files with 380 additions and 155 deletions.
3 changes: 2 additions & 1 deletion ash/fast_ink/fast_ink_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ void FastInkHost::SubmitCompositorFrame() {
->context_factory()
->GetGpuMemoryBufferManager();
resource->mailbox = sii->CreateSharedImage(
gpu_memory_buffer_.get(), gmb_manager, gfx::ColorSpace(), usage);
gpu_memory_buffer_.get(), gmb_manager, gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage);
} else {
sii->UpdateSharedImage(resource->sync_token, resource->mailbox);
}
Expand Down
6 changes: 3 additions & 3 deletions ash/fast_ink/view_tree_host_root_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ void ViewTreeHostRootView::SubmitCompositorFrame() {
aura::Env::GetInstance()
->context_factory()
->GetGpuMemoryBufferManager();
resource->mailbox =
sii->CreateSharedImage(resource->gpu_memory_buffer.get(), gmb_manager,
gfx::ColorSpace(), usage);
resource->mailbox = sii->CreateSharedImage(
resource->gpu_memory_buffer.get(), gmb_manager, gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage);
} else {
sii->UpdateSharedImage(resource->sync_token, resource->mailbox);
}
Expand Down
7 changes: 4 additions & 3 deletions cc/layers/heads_up_display_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ void HeadsUpDisplayLayerImpl::UpdateHudTexture(
}
if (backing->overlay_candidate)
flags |= gpu::SHARED_IMAGE_USAGE_SCANOUT;
backing->mailbox =
sii->CreateSharedImage(pool_resource.format(), pool_resource.size(),
pool_resource.color_space(), flags);
backing->mailbox = sii->CreateSharedImage(
pool_resource.format(), pool_resource.size(),
pool_resource.color_space(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, flags, gpu::kNullSurfaceHandle);
if (raster_context_provider) {
auto* ri = raster_context_provider->RasterInterface();
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
Expand Down
7 changes: 5 additions & 2 deletions cc/paint/oop_pixeltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ class OopPixelTest : public testing::Test,
gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION;
gpu::Mailbox mailbox = sii->CreateSharedImage(
viz::ResourceFormat::RGBA_8888, gfx::Size(width, height),
options.color_space, flags);
options.color_space, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
flags, gpu::kNullSurfaceHandle);
EXPECT_TRUE(mailbox.Verify());
raster_implementation->WaitSyncTokenCHROMIUM(
sii->GenUnverifiedSyncToken().GetConstData());
Expand Down Expand Up @@ -268,7 +269,9 @@ class OopPixelTest : public testing::Test,
uint32_t flags = gpu::SHARED_IMAGE_USAGE_RASTER |
gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION;
gpu::Mailbox mailbox = sii->CreateSharedImage(
image_format, options.resource_size, options.color_space, flags);
image_format, options.resource_size, options.color_space,
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, flags,
gpu::kNullSurfaceHandle);
EXPECT_TRUE(mailbox.Verify());
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());

Expand Down
10 changes: 6 additions & 4 deletions cc/raster/gpu_raster_buffer_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ static void RasterizeSourceOOP(
gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION;
if (texture_is_overlay_candidate)
flags |= gpu::SHARED_IMAGE_USAGE_SCANOUT;
*mailbox = sii->CreateSharedImage(resource_format, resource_size,
color_space, flags);
*mailbox = sii->CreateSharedImage(
resource_format, resource_size, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, flags, gpu::kNullSurfaceHandle);
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
} else {
ri->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
Expand Down Expand Up @@ -192,8 +193,9 @@ static void RasterizeSource(
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT;
if (texture_is_overlay_candidate)
flags |= gpu::SHARED_IMAGE_USAGE_SCANOUT;
*mailbox = sii->CreateSharedImage(resource_format, resource_size,
color_space, flags);
*mailbox = sii->CreateSharedImage(
resource_format, resource_size, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, flags, gpu::kNullSurfaceHandle);
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
} else {
// Wait on the SyncToken that was created on the compositor thread after
Expand Down
11 changes: 6 additions & 5 deletions cc/raster/one_copy_raster_buffer_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,17 @@ gpu::SyncToken OneCopyRasterBufferProvider::CopyOnWorkerThread(
gpu::SHARED_IMAGE_USAGE_DISPLAY | gpu::SHARED_IMAGE_USAGE_RASTER;
if (mailbox_texture_is_overlay_candidate)
usage |= gpu::SHARED_IMAGE_USAGE_SCANOUT;
*mailbox = sii->CreateSharedImage(resource_format, resource_size,
color_space, usage);
*mailbox = sii->CreateSharedImage(
resource_format, resource_size, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, usage, gpu::kNullSurfaceHandle);
}

// Create staging shared image.
if (staging_buffer->mailbox.IsZero()) {
const uint32_t usage = gpu::SHARED_IMAGE_USAGE_RASTER;
staging_buffer->mailbox =
sii->CreateSharedImage(staging_buffer->gpu_memory_buffer.get(),
gpu_memory_buffer_manager_, color_space, usage);
staging_buffer->mailbox = sii->CreateSharedImage(
staging_buffer->gpu_memory_buffer.get(), gpu_memory_buffer_manager_,
color_space, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage);
} else {
sii->UpdateSharedImage(staging_buffer->sync_token, staging_buffer->mailbox);
}
Expand Down
7 changes: 4 additions & 3 deletions cc/raster/zero_copy_raster_buffer_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ class ZeroCopyRasterBufferImpl : public RasterBuffer {
gpu::SHARED_IMAGE_USAGE_DISPLAY | gpu::SHARED_IMAGE_USAGE_SCANOUT;
// Make a mailbox for export of the GpuMemoryBuffer to the display
// compositor.
backing_->mailbox = sii->CreateSharedImage(gpu_memory_buffer_.get(),
gpu_memory_buffer_manager_,
resource_color_space_, usage);
backing_->mailbox = sii->CreateSharedImage(
gpu_memory_buffer_.get(), gpu_memory_buffer_manager_,
resource_color_space_, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
usage);
} else {
sii->UpdateSharedImage(backing_->returned_sync_token, backing_->mailbox);
}
Expand Down
6 changes: 4 additions & 2 deletions cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5945,7 +5945,8 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
layer_tree_frame_sink_->context_provider();
auto* sii = context_provider->SharedImageInterface();
mailbox = sii->CreateSharedImage(
format, upload_size, color_space, shared_image_usage,
format, upload_size, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, shared_image_usage,
base::span<const uint8_t>(bitmap.GetPixels(), bitmap.SizeInBytes()));
} else {
DCHECK_EQ(bitmap.GetFormat(), UIResourceBitmap::RGBA8);
Expand Down Expand Up @@ -6009,7 +6010,8 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
layer_tree_frame_sink_->context_provider();
auto* sii = context_provider->SharedImageInterface();
mailbox = sii->CreateSharedImage(
format, upload_size, color_space, shared_image_usage,
format, upload_size, color_space, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, shared_image_usage,
base::span<const uint8_t>(
reinterpret_cast<const uint8_t*>(pixmap.addr()),
pixmap.computeByteSize()));
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/vr/mailbox_to_surface_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ gpu::MailboxHolder MailboxToSurfaceBridge::CreateSharedImage(
DCHECK(sii);

gpu::MailboxHolder mailbox_holder;
mailbox_holder.mailbox =
sii->CreateSharedImage(buffer, nullptr, color_space, usage);
mailbox_holder.mailbox = sii->CreateSharedImage(buffer, nullptr, color_space,
kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, usage);
mailbox_holder.sync_token = sii->GenVerifiedSyncToken();
DCHECK(!gpu::NativeBufferNeedsPlatformSpecificTextureTarget(
buffer->GetFormat()));
Expand Down
7 changes: 5 additions & 2 deletions components/exo/buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ Buffer::Texture::Texture(
gpu::SHARED_IMAGE_USAGE_RASTER | gpu::SHARED_IMAGE_USAGE_DISPLAY;

mailbox_ = sii->CreateSharedImage(viz::ResourceFormat::RGBA_8888, size,
gfx::ColorSpace(), usage);
gfx::ColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, usage,
gpu::kNullSurfaceHandle);
DCHECK(!mailbox_.IsZero());
gpu::raster::RasterInterface* ri = context_provider_->RasterInterface();
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
Expand Down Expand Up @@ -161,7 +163,8 @@ Buffer::Texture::Texture(
gpu::SHARED_IMAGE_USAGE_SCANOUT;

mailbox_ = sii->CreateSharedImage(
gpu_memory_buffer_, gpu_memory_buffer_manager, gfx::ColorSpace(), usage);
gpu_memory_buffer_, gpu_memory_buffer_manager, gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage);
DCHECK(!mailbox_.IsZero());
gpu::raster::RasterInterface* ri = context_provider_->RasterInterface();
ri->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
Expand Down
4 changes: 3 additions & 1 deletion components/viz/client/client_resource_provider_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ TEST_P(ClientResourceProviderTest, ReturnedSyncTokensArePassedToClient) {
auto* sii = context_provider()->SharedImageInterface();
gpu::Mailbox mailbox = sii->CreateSharedImage(
ResourceFormat::RGBA_8888, gfx::Size(1, 1), gfx::ColorSpace(),
gpu::SHARED_IMAGE_USAGE_GLES2 | gpu::SHARED_IMAGE_USAGE_DISPLAY);
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_GLES2 | gpu::SHARED_IMAGE_USAGE_DISPLAY,
gpu::kNullSurfaceHandle);
gpu::SyncToken sync_token = sii->GenUnverifiedSyncToken();

constexpr gfx::Size size(64, 64);
Expand Down
7 changes: 4 additions & 3 deletions components/viz/service/display/gl_renderer_copier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,10 @@ void GLRendererCopier::RenderAndSendTextureResult(
DCHECK_EQ(request->result_format(), ResultFormat::RGBA_TEXTURE);

auto* sii = context_provider_->SharedImageInterface();
gpu::Mailbox mailbox =
sii->CreateSharedImage(ResourceFormat::RGBA_8888, result_rect.size(),
color_space, gpu::SHARED_IMAGE_USAGE_GLES2);
gpu::Mailbox mailbox = sii->CreateSharedImage(
ResourceFormat::RGBA_8888, result_rect.size(), color_space,
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_GLES2, gpu::kNullSurfaceHandle);
auto* gl = context_provider_->ContextGL();
gl->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
GLuint texture = gl->CreateAndTexStorage2DSharedImageCHROMIUM(mailbox.name);
Expand Down
3 changes: 2 additions & 1 deletion components/viz/service/display/renderer_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ TransferableResource CreateTestTexture(
child_context_provider->SharedImageInterface();
DCHECK(sii);
gpu::Mailbox mailbox = sii->CreateSharedImage(
RGBA_8888, size, gfx::ColorSpace(), gpu::SHARED_IMAGE_USAGE_DISPLAY,
RGBA_8888, size, gfx::ColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, gpu::SHARED_IMAGE_USAGE_DISPLAY,
MakePixelSpan(pixels));
gpu::SyncToken sync_token = sii->GenVerifiedSyncToken();

Expand Down
3 changes: 2 additions & 1 deletion components/viz/service/display/renderer_pixeltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ ResourceId CreateGpuResource(scoped_refptr<ContextProvider> context_provider,
gpu::SharedImageInterface* sii = context_provider->SharedImageInterface();
DCHECK(sii);
gpu::Mailbox mailbox = sii->CreateSharedImage(
format, size, color_space, gpu::SHARED_IMAGE_USAGE_DISPLAY, pixels);
format, size, color_space, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_DISPLAY, pixels);
gpu::SyncToken sync_token = sii->GenUnverifiedSyncToken();

TransferableResource gl_resource = TransferableResource::MakeGL(
Expand Down
6 changes: 3 additions & 3 deletions components/viz/service/display/skia_readback_pixeltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class SkiaReadbackPixelTest : public cc::PixelTest,
gpu::SharedImageInterface* sii =
child_context_provider_->SharedImageInterface();
DCHECK(sii);
gpu::Mailbox mailbox =
sii->CreateSharedImage(format, size, gfx::ColorSpace(),
gpu::SHARED_IMAGE_USAGE_DISPLAY, pixels);
gpu::Mailbox mailbox = sii->CreateSharedImage(
format, size, gfx::ColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, gpu::SHARED_IMAGE_USAGE_DISPLAY, pixels);
gpu::SyncToken sync_token = sii->GenUnverifiedSyncToken();

TransferableResource gl_resource = TransferableResource::MakeGL(
Expand Down
14 changes: 8 additions & 6 deletions components/viz/service/display/texture_deleter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ TEST(TextureDeleterTest, Destroy) {

auto* sii = context_provider->SharedImageInterface();

gpu::Mailbox mailbox =
sii->CreateSharedImage(ResourceFormat::RGBA_8888, gfx::Size(1, 1),
gfx::ColorSpace(), gpu::SHARED_IMAGE_USAGE_GLES2);
gpu::Mailbox mailbox = sii->CreateSharedImage(
ResourceFormat::RGBA_8888, gfx::Size(1, 1), gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_GLES2, gpu::kNullSurfaceHandle);

EXPECT_TRUE(context_provider->HasOneRef());
EXPECT_EQ(1u, sii->shared_image_count());
Expand Down Expand Up @@ -58,9 +59,10 @@ TEST(TextureDeleterTest, NullTaskRunner) {

auto* sii = context_provider->SharedImageInterface();

gpu::Mailbox mailbox =
sii->CreateSharedImage(ResourceFormat::RGBA_8888, gfx::Size(1, 1),
gfx::ColorSpace(), gpu::SHARED_IMAGE_USAGE_GLES2);
gpu::Mailbox mailbox = sii->CreateSharedImage(
ResourceFormat::RGBA_8888, gfx::Size(1, 1), gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_GLES2, gpu::kNullSurfaceHandle);

EXPECT_TRUE(context_provider->HasOneRef());
EXPECT_EQ(1u, sii->shared_image_count());
Expand Down
3 changes: 2 additions & 1 deletion components/viz/service/display_embedder/buffer_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface(
DCHECK(format_);
const ResourceFormat format = GetResourceFormat(format_.value());
const gpu::Mailbox mailbox = sii_->CreateSharedImage(
format, size_, color_space_,
format, size_, color_space_, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_SCANOUT |
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT,
surface_handle_);
Expand Down
15 changes: 10 additions & 5 deletions components/viz/service/display_embedder/buffer_queue_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,16 @@ const gfx::Rect overlapping_damage = gfx::Rect(gfx::Size(5, 20));
class MockedSharedImageInterface : public TestSharedImageInterface {
public:
MockedSharedImageInterface() {
ON_CALL(*this, CreateSharedImage(_, _, _, _, _))
ON_CALL(*this, CreateSharedImage(_, _, _, _, _, _, _))
.WillByDefault(Return(gpu::Mailbox()));
// this, &MockedSharedImageInterface::TestCreateSharedImage));
}
MOCK_METHOD5(CreateSharedImage,
MOCK_METHOD7(CreateSharedImage,
gpu::Mailbox(ResourceFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage,
gpu::SurfaceHandle surface_handle));
MOCK_METHOD2(UpdateSharedImage,
Expand All @@ -247,10 +249,13 @@ class MockedSharedImageInterface : public TestSharedImageInterface {
gpu::Mailbox TestCreateSharedImage(ResourceFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage,
gpu::SurfaceHandle surface_handle) {
return TestSharedImageInterface::CreateSharedImage(
format, size, color_space, usage, surface_handle);
format, size, color_space, surface_origin, alpha_type, usage,
surface_handle);
}
};

Expand Down Expand Up @@ -302,7 +307,7 @@ TEST(BufferQueueStandaloneTest, BufferCreationAndDestruction) {
{
testing::InSequence dummy;
EXPECT_CALL(*sii, CreateSharedImage(
_, _, _,
_, _, _, _, _,
gpu::SHARED_IMAGE_USAGE_SCANOUT |
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT,
_))
Expand Down Expand Up @@ -601,7 +606,7 @@ TEST_F(BufferQueueMockedSharedImageInterfaceTest, AllocateFails) {
EXPECT_TRUE(output_surface_->Reshape(screen_size, kBufferQueueColorSpace,
kBufferQueueFormat));
EXPECT_CALL(*sii_, CreateSharedImage(
_, _, _,
_, _, _, _, _,
gpu::SHARED_IMAGE_USAGE_SCANOUT |
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT,
_))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ void GLOutputSurfaceOffscreen::EnsureBackbuffer() {
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT |
gpu::SHARED_IMAGE_USAGE_DISPLAY;

mailbox_ = sii->CreateSharedImage(kFboTextureFormat, texture_size,
color_space_, flags);
mailbox_ = sii->CreateSharedImage(
kFboTextureFormat, texture_size, color_space_, kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, flags, gpu::kNullSurfaceHandle);

// Ensure mailbox is valid before using it.
gl->WaitSyncTokenCHROMIUM(sii->GenUnverifiedSyncToken().GetConstData());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ class DirectContextProviderDelegateImpl : public DirectContextProviderDelegate,
gpu::Mailbox CreateSharedImage(ResourceFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage,
gpu::SurfaceHandle surface_handle) override {
auto mailbox = gpu::Mailbox::GenerateForSharedImage();
Expand All @@ -553,6 +555,8 @@ class DirectContextProviderDelegateImpl : public DirectContextProviderDelegate,
ResourceFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage,
base::span<const uint8_t> pixel_data) override {
auto mailbox = gpu::Mailbox::GenerateForSharedImage();
Expand All @@ -566,6 +570,8 @@ class DirectContextProviderDelegateImpl : public DirectContextProviderDelegate,
gfx::GpuMemoryBuffer* gpu_memory_buffer,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage) override {
// We do not support creating GMB backed SharedImages.
NOTIMPLEMENTED();
Expand Down Expand Up @@ -596,6 +602,8 @@ class DirectContextProviderDelegateImpl : public DirectContextProviderDelegate,
SwapChainMailboxes CreateSwapChain(ResourceFormat format,
const gfx::Size& size,
const gfx::ColorSpace& color_space,
GrSurfaceOrigin surface_origin,
SkAlphaType alpha_type,
uint32_t usage) override {
NOTREACHED();
return {};
Expand Down
3 changes: 2 additions & 1 deletion components/viz/test/fake_skia_output_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ void FakeSkiaOutputSurface::CopyOutput(
auto* sii = context_provider_->SharedImageInterface();
gpu::Mailbox mailbox = sii->CreateSharedImage(
ResourceFormat::RGBA_8888, geometry.result_selection.size(),
color_space, gpu::SHARED_IMAGE_USAGE_GLES2);
color_space, kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType,
gpu::SHARED_IMAGE_USAGE_GLES2, gpu::kNullSurfaceHandle);

auto* gl = context_provider_->ContextGL();
gpu::SyncToken sync_token;
Expand Down

0 comments on commit 659c274

Please sign in to comment.