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

Unified Diff: ui/gl/gl_image_egl.cc

Issue 1050923003: zero-copy: Clarify to allocate/destroy GpuMemoryBuffer on any thread and use it on the main thread o (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase comment in gpu_channel_manager.cc Created 5 years, 8 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 | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_egl.cc
diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc
index c0a404c98ae7d6cff096ddd93f99c6b48a23e045..df4ce31d5af0ec9c3ea10df1c9e85b24b543d4c2 100644
--- a/ui/gl/gl_image_egl.cc
+++ b/ui/gl/gl_image_egl.cc
@@ -14,12 +14,14 @@ GLImageEGL::GLImageEGL(const gfx::Size& size)
}
GLImageEGL::~GLImageEGL() {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_);
}
bool GLImageEGL::Initialize(EGLenum target,
EGLClientBuffer buffer,
const EGLint* attrs) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_);
egl_image_ = eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(),
EGL_NO_CONTEXT,
@@ -35,6 +37,7 @@ bool GLImageEGL::Initialize(EGLenum target,
}
void GLImageEGL::Destroy(bool have_context) {
+ DCHECK(thread_checker_.CalledOnValidThread());
if (egl_image_ != EGL_NO_IMAGE_KHR) {
EGLBoolean result =
eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_);
@@ -49,6 +52,7 @@ void GLImageEGL::Destroy(bool have_context) {
gfx::Size GLImageEGL::GetSize() { return size_; }
bool GLImageEGL::BindTexImage(unsigned target) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_);
glEGLImageTargetTexture2DOES(target, egl_image_);
DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
« no previous file with comments | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698