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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 2226193002: Not for commit: crash GPU process in glCreateGpuMemoryBufferImageCHROMIUM. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 // ETC1 does not support preallocation. 1843 // ETC1 does not support preallocation.
1844 if (format != ETC1) { 1844 if (format != ETC1) {
1845 gl->TexImage2D(resource->target, 0, GLInternalFormat(format), 1845 gl->TexImage2D(resource->target, 0, GLInternalFormat(format),
1846 size.width(), size.height(), 0, GLDataFormat(format), 1846 size.width(), size.height(), 0, GLDataFormat(format),
1847 GLDataType(format), nullptr); 1847 GLDataType(format), nullptr);
1848 } 1848 }
1849 } 1849 }
1850 } 1850 }
1851 1851
1852 void ResourceProvider::LazyCreateImage(Resource* resource) { 1852 void ResourceProvider::LazyCreateImage(Resource* resource) {
1853 DCHECK(resource->gpu_memory_buffer); 1853 // DCHECK(resource->gpu_memory_buffer);
1854 DCHECK(resource->gl_id); 1854 // DCHECK(resource->gl_id);
1855 DCHECK(resource->allocated); 1855 // DCHECK(resource->allocated);
1856 // Avoid crashing in release builds if GpuMemoryBuffer allocation fails. 1856 // Avoid crashing in release builds if GpuMemoryBuffer allocation fails.
1857 // http://crbug.com/554541 1857 // http://crbug.com/554541
1858 if (!resource->gpu_memory_buffer) 1858 if (!resource->gpu_memory_buffer)
1859 return; 1859 return;
1860 if (!resource->image_id) { 1860 if (!resource->image_id) {
1861 GLES2Interface* gl = ContextGL(); 1861 GLES2Interface* gl = ContextGL();
1862 DCHECK(gl); 1862 DCHECK(gl);
1863 1863
1864 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 1864 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
1865 // TODO(reveman): This avoids a performance problem on ARM ChromeOS 1865 // TODO(reveman): This avoids a performance problem on ARM ChromeOS
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 2004
2005 const int kImportance = 2; 2005 const int kImportance = 2;
2006 pmd->CreateSharedGlobalAllocatorDump(guid); 2006 pmd->CreateSharedGlobalAllocatorDump(guid);
2007 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 2007 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
2008 } 2008 }
2009 2009
2010 return true; 2010 return true;
2011 } 2011 }
2012 2012
2013 } // namespace cc 2013 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698