Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1135)

Unified Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 2738573002: Streamline the presentation of ImageBitmapRenderingContext (Closed)
Patch Set: Fix crash in gpu test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index f27228c01ecb4dcdb2c8863a57c1c6aa11840f99..a7519bb7d57549ca4c4bbd481f3115738fde7db3 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -981,8 +981,9 @@ void Canvas2DLayerBridge::mailboxReleased(const gpu::Mailbox& mailbox,
#if USE_IOSURFACE_FOR_2D_CANVAS
DCHECK(!releasedMailboxInfo->m_imageInfo);
#endif // USE_IOSURFACE_FOR_2D_CANVAS
- if (syncToken.HasData()) {
- contextGL()->WaitSyncTokenCHROMIUM(syncToken.GetConstData());
+ gpu::gles2::GLES2Interface* gl = contextGL();
+ if (syncToken.HasData() && gl) {
+ gl->WaitSyncTokenCHROMIUM(syncToken.GetConstData());
}
GrTexture* texture = releasedMailboxInfo->m_image->getTexture();
if (texture) {
@@ -992,7 +993,6 @@ void Canvas2DLayerBridge::mailboxReleased(const gpu::Mailbox& mailbox,
texture->textureParamsModified();
// Break the mailbox association to avoid leaking mailboxes every time
// skia recycles a texture.
- gpu::gles2::GLES2Interface* gl = contextGL();
if (gl)
gl->ProduceTextureDirectCHROMIUM(
0, GL_TEXTURE_2D, releasedMailboxInfo->m_mailbox.name);

Powered by Google App Engine
This is Rietveld 408576698