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

Unified Diff: cc/resources/resource_provider.cc

Issue 124063003: [NOT FOR COMMIT] Hacks to get hardware canvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mass corruption on detach Created 6 years, 12 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
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698