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 a923d797048a31e8519d630e5914fdceae7a2c28..baef5a9cb77590dd552fb166808fc209296a1894 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); |