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

Unified Diff: ui/gl/gl_image_glx.cc

Issue 1418603002: Revert of 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: 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_glx.cc
diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
index f2eddf960da80d97c9b95cfb86b3d6d36ad69061..496cf449bb8984a4561f914999b2fb354fcec9c3 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -13,6 +13,7 @@
#include "ui/gl/gl_surface_glx.h"
namespace gfx {
+
namespace {
bool ValidFormat(unsigned internalformat) {
@@ -61,7 +62,7 @@
}
}
-bool ActualPixmapGeometry(XID pixmap, Size* size, unsigned* depth) {
+bool ActualPixmapGeometry(XID pixmap, gfx::Size* size, unsigned* depth) {
XID root_return;
int x_return;
int y_return;
@@ -69,13 +70,19 @@
unsigned height_return;
unsigned border_width_return;
unsigned depth_return;
- if (!XGetGeometry(GetXDisplay(), pixmap, &root_return, &x_return, &y_return,
- &width_return, &height_return, &border_width_return,
+ if (!XGetGeometry(gfx::GetXDisplay(),
+ pixmap,
+ &root_return,
+ &x_return,
+ &y_return,
+ &width_return,
+ &height_return,
+ &border_width_return,
&depth_return))
return false;
if (size)
- *size = Size(width_return, height_return);
+ *size = gfx::Size(width_return, height_return);
if (depth)
*depth = depth_return;
return true;
@@ -89,18 +96,19 @@
return depth;
}
-Size ActualPixmapSize(XID pixmap) {
- Size size;
+gfx::Size ActualPixmapSize(XID pixmap) {
+ gfx::Size size;
if (!ActualPixmapGeometry(pixmap, &size, NULL))
- return Size();
+ return gfx::Size();
return size;
}
-} // namespace
-
-GLImageGLX::GLImageGLX(const Size& size, unsigned internalformat)
- : glx_pixmap_(0), size_(size), internalformat_(internalformat) {}
+} // namespace anonymous
+
+GLImageGLX::GLImageGLX(const gfx::Size& size, unsigned internalformat)
+ : glx_pixmap_(0), size_(size), internalformat_(internalformat) {
+}
GLImageGLX::~GLImageGLX() {
DCHECK_EQ(0u, glx_pixmap_);
@@ -126,8 +134,8 @@
BindToTextureFormat(internalformat_), GL_TRUE,
0};
int num_elements = 0;
- XScopedPtr<GLXFBConfig> config(
- glXChooseFBConfig(GetXDisplay(), DefaultScreen(GetXDisplay()),
+ gfx::XScopedPtr<GLXFBConfig> config(
+ glXChooseFBConfig(gfx::GetXDisplay(), DefaultScreen(gfx::GetXDisplay()),
config_attribs, &num_elements));
if (!config.get()) {
DVLOG(0) << "glXChooseFBConfig failed.";
@@ -141,8 +149,8 @@
int pixmap_attribs[] = {GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
GLX_TEXTURE_FORMAT_EXT,
TextureFormat(internalformat_), 0};
- glx_pixmap_ =
- glXCreatePixmap(GetXDisplay(), *config.get(), pixmap, pixmap_attribs);
+ glx_pixmap_ = glXCreatePixmap(
+ gfx::GetXDisplay(), *config.get(), pixmap, pixmap_attribs);
if (!glx_pixmap_) {
DVLOG(0) << "glXCreatePixmap failed.";
return false;
@@ -153,14 +161,12 @@
void GLImageGLX::Destroy(bool have_context) {
if (glx_pixmap_) {
- glXDestroyGLXPixmap(GetXDisplay(), glx_pixmap_);
+ glXDestroyGLXPixmap(gfx::GetXDisplay(), glx_pixmap_);
glx_pixmap_ = 0;
}
}
-Size GLImageGLX::GetSize() {
- return size_;
-}
+gfx::Size GLImageGLX::GetSize() { return size_; }
unsigned GLImageGLX::GetInternalFormat() { return internalformat_; }
@@ -172,7 +178,7 @@
if (target != GL_TEXTURE_2D)
return false;
- glXBindTexImageEXT(GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT, 0);
+ glXBindTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT, 0);
return true;
}
@@ -180,11 +186,7 @@
DCHECK_NE(0u, glx_pixmap_);
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), target);
- glXReleaseTexImageEXT(GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT);
-}
-
-bool GLImageGLX::CopyTexImage(unsigned target) {
- return false;
+ glXReleaseTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT);
}
bool GLImageGLX::CopyTexSubImage(unsigned target,
@@ -193,7 +195,7 @@
return false;
}
-bool GLImageGLX::ScheduleOverlayPlane(AcceleratedWidget widget,
+bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
« 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