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

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

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix stream texture issue Created 5 years, 2 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 | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_glx.h » ('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 (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 gfx { 10 namespace gfx {
11 11
12 GLImageEGL::GLImageEGL(const gfx::Size& size) 12 GLImageEGL::GLImageEGL(const Size& size)
13 : egl_image_(EGL_NO_IMAGE_KHR), size_(size) { 13 : egl_image_(EGL_NO_IMAGE_KHR), size_(size) {}
14 }
15 14
16 GLImageEGL::~GLImageEGL() { 15 GLImageEGL::~GLImageEGL() {
17 DCHECK(thread_checker_.CalledOnValidThread()); 16 DCHECK(thread_checker_.CalledOnValidThread());
18 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_); 17 DCHECK_EQ(EGL_NO_IMAGE_KHR, egl_image_);
19 } 18 }
20 19
21 bool GLImageEGL::Initialize(EGLenum target, 20 bool GLImageEGL::Initialize(EGLenum target,
22 EGLClientBuffer buffer, 21 EGLClientBuffer buffer,
23 const EGLint* attrs) { 22 const EGLint* attrs) {
24 DCHECK(thread_checker_.CalledOnValidThread()); 23 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 17 matching lines...) Expand all
42 EGLBoolean result = 41 EGLBoolean result =
43 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_); 42 eglDestroyImageKHR(GLSurfaceEGL::GetHardwareDisplay(), egl_image_);
44 if (result == EGL_FALSE) { 43 if (result == EGL_FALSE) {
45 DLOG(ERROR) << "Error destroying EGLImage: " 44 DLOG(ERROR) << "Error destroying EGLImage: "
46 << ui::GetLastEGLErrorString(); 45 << ui::GetLastEGLErrorString();
47 } 46 }
48 egl_image_ = EGL_NO_IMAGE_KHR; 47 egl_image_ = EGL_NO_IMAGE_KHR;
49 } 48 }
50 } 49 }
51 50
52 gfx::Size GLImageEGL::GetSize() { return size_; } 51 Size GLImageEGL::GetSize() {
52 return size_;
53 }
53 54
54 unsigned GLImageEGL::GetInternalFormat() { return GL_RGBA; } 55 unsigned GLImageEGL::GetInternalFormat() { return GL_RGBA; }
55 56
56 bool GLImageEGL::BindTexImage(unsigned target) { 57 bool GLImageEGL::BindTexImage(unsigned target) {
57 DCHECK(thread_checker_.CalledOnValidThread()); 58 DCHECK(thread_checker_.CalledOnValidThread());
58 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_); 59 DCHECK_NE(EGL_NO_IMAGE_KHR, egl_image_);
59 glEGLImageTargetTexture2DOES(target, egl_image_); 60 glEGLImageTargetTexture2DOES(target, egl_image_);
60 DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 61 DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
61 return true; 62 return true;
62 } 63 }
63 64
65 bool GLImageEGL::CopyTexImage(unsigned target) {
66 return false;
67 }
68
64 bool GLImageEGL::CopyTexSubImage(unsigned target, 69 bool GLImageEGL::CopyTexSubImage(unsigned target,
65 const Point& offset, 70 const Point& offset,
66 const Rect& rect) { 71 const Rect& rect) {
67 return false; 72 return false;
68 } 73 }
69 74
70 bool GLImageEGL::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 75 bool GLImageEGL::ScheduleOverlayPlane(AcceleratedWidget widget,
71 int z_order, 76 int z_order,
72 OverlayTransform transform, 77 OverlayTransform transform,
73 const Rect& bounds_rect, 78 const Rect& bounds_rect,
74 const RectF& crop_rect) { 79 const RectF& crop_rect) {
75 return false; 80 return false;
76 } 81 }
77 82
78 } // namespace gfx 83 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_image_egl.h ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698