OLD | NEW |
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/egl_util.h" |
8 #include "ui/gl/gl_surface_egl.h" | 8 #include "ui/gl/gl_surface_egl.h" |
9 | 9 |
10 namespace gl { | 10 namespace gl { |
(...skipping 30 matching lines...) Expand all Loading... |
41 EGLBoolean result = | 41 EGLBoolean result = |
42 eglDestroyImageKHR(gfx::GLSurfaceEGL::GetHardwareDisplay(), egl_image_); | 42 eglDestroyImageKHR(gfx::GLSurfaceEGL::GetHardwareDisplay(), egl_image_); |
43 if (result == EGL_FALSE) { | 43 if (result == EGL_FALSE) { |
44 DLOG(ERROR) << "Error destroying EGLImage: " | 44 DLOG(ERROR) << "Error destroying EGLImage: " |
45 << ui::GetLastEGLErrorString(); | 45 << ui::GetLastEGLErrorString(); |
46 } | 46 } |
47 egl_image_ = EGL_NO_IMAGE_KHR; | 47 egl_image_ = EGL_NO_IMAGE_KHR; |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
| 51 bool GLImageEGL::IsValid() { |
| 52 return egl_image_ != EGL_NO_IMAGE_KHR; |
| 53 } |
| 54 |
51 gfx::Size GLImageEGL::GetSize() { | 55 gfx::Size GLImageEGL::GetSize() { |
52 return size_; | 56 return size_; |
53 } | 57 } |
54 | 58 |
55 unsigned GLImageEGL::GetInternalFormat() { return GL_RGBA; } | 59 unsigned GLImageEGL::GetInternalFormat() { return GL_RGBA; } |
56 | 60 |
57 bool GLImageEGL::BindTexImage(unsigned target) { | 61 bool GLImageEGL::BindTexImage(unsigned target) { |
58 DCHECK(thread_checker_.CalledOnValidThread()); | 62 DCHECK(thread_checker_.CalledOnValidThread()); |
59 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_); | 63 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_); |
60 glEGLImageTargetTexture2DOES(target, egl_image_); | 64 glEGLImageTargetTexture2DOES(target, egl_image_); |
(...skipping 13 matching lines...) Expand all Loading... |
74 | 78 |
75 bool GLImageEGL::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 79 bool GLImageEGL::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
76 int z_order, | 80 int z_order, |
77 gfx::OverlayTransform transform, | 81 gfx::OverlayTransform transform, |
78 const gfx::Rect& bounds_rect, | 82 const gfx::Rect& bounds_rect, |
79 const gfx::RectF& crop_rect) { | 83 const gfx::RectF& crop_rect) { |
80 return false; | 84 return false; |
81 } | 85 } |
82 | 86 |
83 } // namespace gl | 87 } // namespace gl |
OLD | NEW |