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

Unified Diff: ui/gl/gl_image_io_surface.cc

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change destroy flow for all GLImage types. Created 6 years, 7 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: ui/gl/gl_image_io_surface.cc
diff --git a/ui/gl/gl_image_io_surface.cc b/ui/gl/gl_image_io_surface.cc
index e20c739cffad6ce232405e4cc460e7aeec078a39..4b27d5cbd248c18a1b8cdb31fb52e1b73fb13a60 100644
--- a/ui/gl/gl_image_io_surface.cc
+++ b/ui/gl/gl_image_io_surface.cc
@@ -15,7 +15,9 @@ GLImageIOSurface::GLImageIOSurface(gfx::Size size)
CHECK(io_surface_support_);
}
-GLImageIOSurface::~GLImageIOSurface() { Destroy(); }
+GLImageIOSurface::~GLImageIOSurface() {
+ DCHECK(!io_surface_);
+}
bool GLImageIOSurface::Initialize(gfx::GpuMemoryBufferHandle buffer) {
io_surface_.reset(io_surface_support_->IOSurfaceLookup(buffer.io_surface_id));
@@ -27,6 +29,11 @@ bool GLImageIOSurface::Initialize(gfx::GpuMemoryBufferHandle buffer) {
return true;
}
+void GLImageIOSurface::Destroy(bool have_context) {
+ DCHECK(io_surface_);
reveman 2014/05/31 05:05:06 This DCHECK seems inconsistent with other implemen
sohanjg 2014/06/02 13:59:42 Done.
+ io_surface_.reset()
+}
+
gfx::Size GLImageIOSurface::GetSize() { return size_; }
bool GLImageIOSurface::BindTexImage(unsigned target) {

Powered by Google App Engine
This is Rietveld 408576698