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

Side by Side Diff: ui/gl/gl_image_egl.cc

Issue 1066483003: gpu: Log a failure in GLImageEGL::Destroy() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/gl/gl_image_egl.h" 5 #include "ui/gl/gl_image_egl.h"
6 6
7 #include "ui/gl/egl_util.h"
7 #include "ui/gl/gl_surface_egl.h" 8 #include "ui/gl/gl_surface_egl.h"
8 9
9 namespace gfx { 10 namespace gfx {
10 11
11 GLImageEGL::GLImageEGL(const gfx::Size& size) 12 GLImageEGL::GLImageEGL(const gfx::Size& size)
12 : egl_image_(EGL_NO_IMAGE_KHR), size_(size) { 13 : egl_image_(EGL_NO_IMAGE_KHR), size_(size) {
13 } 14 }
14 15
15 GLImageEGL::~GLImageEGL() { 16 GLImageEGL::~GLImageEGL() {
16 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); 17 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_);
17 } 18 }
18 19
19 bool GLImageEGL::Initialize(EGLenum target, 20 bool GLImageEGL::Initialize(EGLenum target,
20 EGLClientBuffer buffer, 21 EGLClientBuffer buffer,
21 const EGLint* attrs) { 22 const EGLint* attrs) {
22 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); 23 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_);
23 egl_image_ = eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(), 24 egl_image_ = eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(),
24 EGL_NO_CONTEXT, 25 EGL_NO_CONTEXT,
25 target, 26 target,
26 buffer, 27 buffer,
27 attrs); 28 attrs);
28 if (egl_image_ == EGL_NO_IMAGE_KHR) { 29 if (egl_image_ == EGL_NO_IMAGE_KHR) {
29 EGLint error = eglGetError(); 30 DLOG(ERROR) << "Error creating EGLImage: " << ui::GetLastEGLErrorString();
30 LOG(ERROR) << "Error creating EGLImage: " << error;
31 return false; 31 return false;
32 } 32 }
33 33
34 return true; 34 return true;
35 } 35 }
36 36
37 void GLImageEGL::Destroy(bool have_context) { 37 void GLImageEGL::Destroy(bool have_context) {
38 if (egl_image_ != EGL_NO_IMAGE_KHR) { 38 if (egl_image_ != EGL_NO_IMAGE_KHR) {
39 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); 39 EGLBoolean result =
40 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_);
41 if (result == EGL_FALSE) {
42 DLOG(ERROR) << "Error destroying EGLImage: "
43 << ui::GetLastEGLErrorString();
44 }
40 egl_image_ = EGL_NO_IMAGE_KHR; 45 egl_image_ = EGL_NO_IMAGE_KHR;
41 } 46 }
42 } 47 }
43 48
44 gfx::Size GLImageEGL::GetSize() { return size_; } 49 gfx::Size GLImageEGL::GetSize() { return size_; }
45 50
46 bool GLImageEGL::BindTexImage(unsigned target) { 51 bool GLImageEGL::BindTexImage(unsigned target) {
47 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_); 52 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_);
48 glEGLImageTargetTexture2DOES(target, egl_image_); 53 glEGLImageTargetTexture2DOES(target, egl_image_);
49 DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 54 DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
50 return true; 55 return true;
51 } 56 }
52 57
53 bool GLImageEGL::CopyTexImage(unsigned target) { 58 bool GLImageEGL::CopyTexImage(unsigned target) {
54 return false; 59 return false;
55 } 60 }
56 61
57 bool GLImageEGL::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 62 bool GLImageEGL::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
58 int z_order, 63 int z_order,
59 OverlayTransform transform, 64 OverlayTransform transform,
60 const Rect& bounds_rect, 65 const Rect& bounds_rect,
61 const RectF& crop_rect) { 66 const RectF& crop_rect) {
62 return false; 67 return false;
63 } 68 }
64 69
65 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698