Commit c07e135e authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Remove filter resets after Skia operations in PaintCanvasVideoRenderer

With crrev.com/c/1888951 the display compositor initializes textures to
a known state at draw time so we don't need to manually save/
restore this state after the texture is used by Skia. These calls are
also potential causes of slowdown when copying WebGL/Canvas as discussed
on crbug.com/1048896.

Removing this usage of ContextGL also helps prepare for Canvas'
transition to OOP-Rasterization, crbug.com/1018894.

Bug: 1023270, 1048896
Change-Id: I80e070ec8d1210312ff6bd430c30cfdab2c4f9b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078979
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745635}
parent 2e01a47c
......@@ -212,8 +212,6 @@ GLuint SynchronizeAndImportMailbox(gpu::gles2::GLES2Interface* gl,
static constexpr size_t kNumYUVPlanes = 3;
struct YUVPlaneTextureInfo {
GrGLTextureInfo texture = {0, 0};
GLint minFilter = 0;
GLint magFilter = 0;
bool is_shared_image = false;
};
using YUVTexturesInfo = std::array<YUVPlaneTextureInfo, kNumYUVPlanes>;
......@@ -247,13 +245,6 @@ YUVTexturesInfo GetYUVTexturesInfo(const VideoFrame* video_frame,
yuv_textures_info[i].texture.fTarget = mailbox_holder.texture_target;
yuv_textures_info[i].texture.fFormat = skia_texture_format;
gl->BindTexture(mailbox_holder.texture_target,
yuv_textures_info[i].texture.fID);
gl->GetTexParameteriv(mailbox_holder.texture_target, GL_TEXTURE_MIN_FILTER,
&yuv_textures_info[i].minFilter);
gl->GetTexParameteriv(mailbox_holder.texture_target, GL_TEXTURE_MAG_FILTER,
&yuv_textures_info[i].magFilter);
}
return yuv_textures_info;
......@@ -266,12 +257,6 @@ void DeleteYUVTextures(const VideoFrame* video_frame,
DCHECK(gl);
for (size_t i = 0; i < video_frame->NumTextures(); ++i) {
gl->BindTexture(yuv_textures_info[i].texture.fTarget,
yuv_textures_info[i].texture.fID);
gl->TexParameteri(yuv_textures_info[i].texture.fTarget,
GL_TEXTURE_MIN_FILTER, yuv_textures_info[i].minFilter);
gl->TexParameteri(yuv_textures_info[i].texture.fTarget,
GL_TEXTURE_MAG_FILTER, yuv_textures_info[i].magFilter);
if (yuv_textures_info[i].is_shared_image)
gl->EndSharedImageAccessDirectCHROMIUM(yuv_textures_info[i].texture.fID);
gl->DeleteTextures(1, &yuv_textures_info[i].texture.fID);
......
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