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

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

Issue 1140683002: glBindTexImage2DCHROMIUM should retain pixel format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GetInternalFormat override to MockGLImage. Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_image_glx.h ('k') | ui/gl/gl_image_io_surface.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 void GLImageGLX::Destroy(bool have_context) { 162 void GLImageGLX::Destroy(bool have_context) {
163 if (glx_pixmap_) { 163 if (glx_pixmap_) {
164 glXDestroyGLXPixmap(gfx::GetXDisplay(), glx_pixmap_); 164 glXDestroyGLXPixmap(gfx::GetXDisplay(), glx_pixmap_);
165 glx_pixmap_ = 0; 165 glx_pixmap_ = 0;
166 } 166 }
167 } 167 }
168 168
169 gfx::Size GLImageGLX::GetSize() { return size_; } 169 gfx::Size GLImageGLX::GetSize() { return size_; }
170 170
171 unsigned GLImageGLX::GetInternalFormat() { return internalformat_; }
172
171 bool GLImageGLX::BindTexImage(unsigned target) { 173 bool GLImageGLX::BindTexImage(unsigned target) {
172 if (!glx_pixmap_) 174 if (!glx_pixmap_)
173 return false; 175 return false;
174 176
175 // Requires TEXTURE_2D target. 177 // Requires TEXTURE_2D target.
176 if (target != GL_TEXTURE_2D) 178 if (target != GL_TEXTURE_2D)
177 return false; 179 return false;
178 180
179 glXBindTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT, 0); 181 glXBindTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT, 0);
180 return true; 182 return true;
(...skipping 12 matching lines...) Expand all
193 195
194 bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 196 bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
195 int z_order, 197 int z_order,
196 OverlayTransform transform, 198 OverlayTransform transform,
197 const Rect& bounds_rect, 199 const Rect& bounds_rect,
198 const RectF& crop_rect) { 200 const RectF& crop_rect) {
199 return false; 201 return false;
200 } 202 }
201 203
202 } // namespace gfx 204 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_image_glx.h ('k') | ui/gl/gl_image_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698