Commit 11d96ec0 authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

Pass SharedImageRepresentationGLTextureClient if graphics context is GL.

Previous code may pass nullptr if cached_promise_texture_ already
exists. This CL also explicitly checks GrContextIsGL rather than
!GrContextIsMetal.

Bug: 1105698
Test: Youtube works in lacros chrome
Change-Id: I19c468d8d007f0156e85996fd5b43cd13e9e6e57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299680
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Reviewed-by: default avatarGeoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788783}
parent 7df52de7
......@@ -859,7 +859,6 @@ SharedImageBackingGLImage::ProduceSkia(
SharedImageManager* manager,
MemoryTypeTracker* tracker,
scoped_refptr<SharedContextState> context_state) {
SharedImageRepresentationGLTextureClient* gl_client = nullptr;
if (!cached_promise_texture_) {
if (context_state->GrContextIsMetal()) {
#if defined(OS_MACOSX)
......@@ -869,7 +868,6 @@ SharedImageBackingGLImage::ProduceSkia(
DCHECK(cached_promise_texture_);
#endif
} else {
gl_client = this;
GrBackendTexture backend_texture;
GetGrBackendTexture(context_state->feature_info(), GetGLTarget(), size(),
GetGLServiceId(), format(), &backend_texture);
......@@ -877,8 +875,8 @@ SharedImageBackingGLImage::ProduceSkia(
}
}
return std::make_unique<SharedImageRepresentationSkiaImpl>(
manager, this, gl_client, std::move(context_state),
cached_promise_texture_, tracker);
manager, this, context_state->GrContextIsGL() ? this : nullptr,
std::move(context_state), cached_promise_texture_, tracker);
}
std::unique_ptr<SharedImageRepresentationGLTexture>
......
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