| Index: cc/resources/resource_provider.cc
|
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
|
| index 3973fb8868c24a9a8d86b4eeea72e5f525dcec60..b6b2f6e8eb5f540932034b59c6350a7586d4252a 100644
|
| --- a/cc/resources/resource_provider.cc
|
| +++ b/cc/resources/resource_provider.cc
|
| @@ -524,35 +524,45 @@ void ResourceProvider::DeleteResourceInternal(ResourceMap::iterator it,
|
|
|
| if (resource->image_id) {
|
| GLES2Interface* gl = ContextGL();
|
| - DCHECK(gl);
|
| - GLC(gl, gl->DestroyImageCHROMIUM(resource->image_id));
|
| + if (gl) {
|
| + DCHECK(gl);
|
| + GLC(gl, gl->DestroyImageCHROMIUM(resource->image_id));
|
| + }
|
| }
|
|
|
| if (resource->gl_id && !resource->external) {
|
| GLES2Interface* gl = ContextGL();
|
| + if (gl) {
|
| DCHECK(gl);
|
| GLC(gl, gl->DeleteTextures(1, &resource->gl_id));
|
| + }
|
| }
|
| if (resource->gl_upload_query_id) {
|
| GLES2Interface* gl = ContextGL();
|
| + if (gl) {
|
| DCHECK(gl);
|
| GLC(gl, gl->DeleteQueriesEXT(1, &resource->gl_upload_query_id));
|
| + }
|
| }
|
| if (resource->gl_pixel_buffer_id) {
|
| GLES2Interface* gl = ContextGL();
|
| + if (gl) {
|
| DCHECK(gl);
|
| GLC(gl, gl->DeleteBuffers(1, &resource->gl_pixel_buffer_id));
|
| + }
|
| }
|
| if (resource->mailbox.IsValid() && resource->external) {
|
| GLuint sync_point = resource->mailbox.sync_point();
|
| if (resource->mailbox.IsTexture()) {
|
| lost_resource |= lost_output_surface_;
|
| GLES2Interface* gl = ContextGL();
|
| - DCHECK(gl);
|
| - if (resource->gl_id)
|
| - GLC(gl, gl->DeleteTextures(1, &resource->gl_id));
|
| - if (!lost_resource && resource->gl_id)
|
| - sync_point = gl->InsertSyncPointCHROMIUM();
|
| + if (gl) {
|
| + DCHECK(gl);
|
| + if (resource->gl_id)
|
| + GLC(gl, gl->DeleteTextures(1, &resource->gl_id));
|
| + if (!lost_resource && resource->gl_id)
|
| + sync_point = gl->InsertSyncPointCHROMIUM();
|
| + }
|
| } else {
|
| DCHECK(resource->mailbox.IsSharedMemory());
|
| base::SharedMemory* shared_memory = resource->mailbox.shared_memory();
|
|
|