diff --git a/gpu/command_buffer/service/image_factory.cc b/gpu/command_buffer/service/image_factory.cc index 75e5d2218a967..d8c86b5a53945 100644 --- a/gpu/command_buffer/service/image_factory.cc +++ b/gpu/command_buffer/service/image_factory.cc @@ -39,6 +39,8 @@ gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat( return gfx::BufferFormat::ETC1; case GL_RGB_YUV_420_CHROMIUM: return gfx::BufferFormat::YUV_420; + case GL_RGB_YCBCR_422_CHROMIUM: + return gfx::BufferFormat::UYVY_422; default: NOTREACHED(); return gfx::BufferFormat::RGBA_8888; @@ -74,11 +76,10 @@ bool ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( case gfx::BufferFormat::R_8: case gfx::BufferFormat::RGBA_8888: case gfx::BufferFormat::YUV_420: + case gfx::BufferFormat::UYVY_422: return format == DefaultBufferFormatForImageFormat(internalformat); case gfx::BufferFormat::RGBA_4444: return internalformat == GL_RGBA; - case gfx::BufferFormat::UYVY_422: - return internalformat == GL_RGB; } NOTREACHED(); @@ -103,11 +104,12 @@ bool ImageFactory::IsGpuMemoryBufferFormatSupported( return capabilities.texture_format_etc1; case gfx::BufferFormat::R_8: return capabilities.texture_rg; + case gfx::BufferFormat::UYVY_422: + return capabilities.image_ycbcr_422; case gfx::BufferFormat::RGBA_4444: case gfx::BufferFormat::RGBA_8888: case gfx::BufferFormat::BGRX_8888: case gfx::BufferFormat::YUV_420: - case gfx::BufferFormat::UYVY_422: return true; } diff --git a/media/blink/skcanvas_video_renderer.cc b/media/blink/skcanvas_video_renderer.cc index 6aa863e89b1bc..edbb556e55927 100644 --- a/media/blink/skcanvas_video_renderer.cc +++ b/media/blink/skcanvas_video_renderer.cc @@ -127,12 +127,6 @@ skia::RefPtr NewSkImageFromVideoFrameYUVTextures( return skia::AdoptRef(img); } -bool ShouldCacheVideoFrameSkImage(const VideoFrame* video_frame) { - return !video_frame->HasTextures() || - media::VideoFrame::NumPlanes(video_frame->format()) != 1 || - video_frame->mailbox_holder(0).texture_target != GL_TEXTURE_2D; -} - // Creates a SkImage from a |video_frame| backed by native resources. // The SkImage will take ownership of the underlying resource. skia::RefPtr NewSkImageFromVideoFrameNative( @@ -388,9 +382,6 @@ void SkCanvasVideoRenderer::Paint(const scoped_refptr& video_frame, // Make sure to flush so we can remove the videoframe from the generator. canvas->flush(); - if (!ShouldCacheVideoFrameSkImage(video_frame.get())) - ResetCache(); - if (video_frame->HasTextures()) { DCHECK(gl); SyncPointClientImpl client(gl);