Fix synchronization bug in video to webgl texture upload
TexImage2D calls with a video element as a source were sometimes
failing because of a texture copy that was missing posterior
synchronization. This meant that it was possible for the source
texture to be recycled by skia (in a different command stream)
before the copy is executed.
Reviewed-by: Justin Novosad <firstname.lastname@example.org>
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
index e24cbb3..b1ddc0d 100644
@@ -174,6 +174,14 @@
// This drops the |destGL| context's reference on our |m_mailbox|, but it's
// still held alive by our SkImage.
+ // We need to update the texture holder's sync token to ensure that when this
+ // image is deleted, the texture resource will not be recycled by skia before
+ // the the above texture copy has completed.
+ gpu::SyncToken sync_token;