Commit 16ff017e authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Remove ContextGL() from AcceleratedStaticBitmapImage

We are almost ready to fully turn off ContextGL on the Shared main
thread context as part of the OOPR Canvas project. This CL replaces
instances of ContextGL with the equivalent RasterInterface APIs in
AcceleratedStaticBitmapImage.

Bug: 1018898
Change-Id: Idf289c02273564ee987066e08421ac4b15384c2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116532Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#752567}
parent 736e3e1e
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "components/viz/common/resources/single_release_callback.h" #include "components/viz/common/resources/single_release_callback.h"
#include "gpu/GLES2/gl2extchromium.h" #include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/raster_interface.h"
#include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h"
#include "gpu/command_buffer/common/sync_token.h" #include "gpu/command_buffer/common/sync_token.h"
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
...@@ -74,10 +75,10 @@ void AcceleratedStaticBitmapImage::ReleaseTexture(void* ctx) { ...@@ -74,10 +75,10 @@ void AcceleratedStaticBitmapImage::ReleaseTexture(void* ctx) {
auto* release_ctx = static_cast<ReleaseContext*>(ctx); auto* release_ctx = static_cast<ReleaseContext*>(ctx);
if (release_ctx->context_provider_wrapper) { if (release_ctx->context_provider_wrapper) {
if (release_ctx->texture_id) { if (release_ctx->texture_id) {
auto* gl = auto* ri = release_ctx->context_provider_wrapper->ContextProvider()
release_ctx->context_provider_wrapper->ContextProvider()->ContextGL(); ->RasterInterface();
gl->EndSharedImageAccessDirectCHROMIUM(release_ctx->texture_id); ri->EndSharedImageAccessDirectCHROMIUM(release_ctx->texture_id);
gl->DeleteTextures(1u, &release_ctx->texture_id); ri->DeleteGpuRasterTexture(release_ctx->texture_id);
} }
} }
...@@ -274,11 +275,11 @@ void AcceleratedStaticBitmapImage::InitializeSkImage( ...@@ -274,11 +275,11 @@ void AcceleratedStaticBitmapImage::InitializeSkImage(
if (!context_provider_wrapper) if (!context_provider_wrapper)
return; return;
gpu::gles2::GLES2Interface* shared_gl = gpu::raster::RasterInterface* shared_ri =
context_provider_wrapper->ContextProvider()->ContextGL(); context_provider_wrapper->ContextProvider()->RasterInterface();
GrContext* shared_gr_context = GrContext* shared_gr_context =
context_provider_wrapper->ContextProvider()->GetGrContext(); context_provider_wrapper->ContextProvider()->GetGrContext();
DCHECK(shared_gl && DCHECK(shared_ri &&
shared_gr_context); // context isValid already checked in callers shared_gr_context); // context isValid already checked in callers
GLuint shared_context_texture_id = 0u; GLuint shared_context_texture_id = 0u;
...@@ -288,12 +289,12 @@ void AcceleratedStaticBitmapImage::InitializeSkImage( ...@@ -288,12 +289,12 @@ void AcceleratedStaticBitmapImage::InitializeSkImage(
shared_context_texture_id = shared_image_texture_id; shared_context_texture_id = shared_image_texture_id;
should_delete_texture_on_release = false; should_delete_texture_on_release = false;
} else { } else {
shared_gl->WaitSyncTokenCHROMIUM( shared_ri->WaitSyncTokenCHROMIUM(
mailbox_ref_->GetOrCreateSyncToken(context_provider_wrapper) mailbox_ref_->GetOrCreateSyncToken(context_provider_wrapper)
.GetConstData()); .GetConstData());
shared_context_texture_id = shared_context_texture_id =
shared_gl->CreateAndTexStorage2DSharedImageCHROMIUM(mailbox_.name); shared_ri->CreateAndConsumeForGpuRaster(mailbox_);
shared_gl->BeginSharedImageAccessDirectCHROMIUM( shared_ri->BeginSharedImageAccessDirectCHROMIUM(
shared_context_texture_id, GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM); shared_context_texture_id, GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM);
} }
......
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