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

Unified Diff: ui/gl/gl_image_glx.cc

Issue 1421903006: ui/gl: Move GLImage into gl namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone demo 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
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..2736e92596d4958f27890561296023936d05d310 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -12,7 +12,7 @@ extern "C" {
#include "ui/gl/gl_image_glx.h"
#include "ui/gl/gl_surface_glx.h"
-namespace gfx {
+namespace gl {
namespace {
bool ValidFormat(unsigned internalformat) {
@@ -61,7 +61,7 @@ unsigned PixmapDepth(unsigned internalformat) {
}
}
-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 +69,13 @@ bool ActualPixmapGeometry(XID pixmap, Size* size, unsigned* depth) {
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,
- &depth_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,17 +89,17 @@ unsigned ActualPixmapDepth(XID pixmap) {
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)
+GLImageGLX::GLImageGLX(const gfx::Size& size, unsigned internalformat)
: glx_pixmap_(0), size_(size), internalformat_(internalformat) {}
GLImageGLX::~GLImageGLX() {
@@ -107,7 +107,7 @@ GLImageGLX::~GLImageGLX() {
}
bool GLImageGLX::Initialize(XID pixmap) {
- if (!GLSurfaceGLX::IsTextureFromPixmapSupported()) {
+ if (!gfx::GLSurfaceGLX::IsTextureFromPixmapSupported()) {
DVLOG(0) << "GLX_EXT_texture_from_pixmap not supported.";
return false;
}
@@ -126,8 +126,8 @@ bool GLImageGLX::Initialize(XID pixmap) {
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 +141,8 @@ bool GLImageGLX::Initialize(XID pixmap) {
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,12 +153,12 @@ bool GLImageGLX::Initialize(XID pixmap) {
void GLImageGLX::Destroy(bool have_context) {
if (glx_pixmap_) {
- glXDestroyGLXPixmap(GetXDisplay(), glx_pixmap_);
+ glXDestroyGLXPixmap(gfx::GetXDisplay(), glx_pixmap_);
glx_pixmap_ = 0;
}
}
-Size GLImageGLX::GetSize() {
+gfx::Size GLImageGLX::GetSize() {
return size_;
}
@@ -172,7 +172,7 @@ bool GLImageGLX::BindTexImage(unsigned target) {
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,7 +180,7 @@ void GLImageGLX::ReleaseTexImage(unsigned target) {
DCHECK_NE(0u, glx_pixmap_);
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), target);
- glXReleaseTexImageEXT(GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT);
+ glXReleaseTexImageEXT(gfx::GetXDisplay(), glx_pixmap_, GLX_FRONT_LEFT_EXT);
}
bool GLImageGLX::CopyTexImage(unsigned target) {
@@ -188,16 +188,16 @@ bool GLImageGLX::CopyTexImage(unsigned target) {
}
bool GLImageGLX::CopyTexSubImage(unsigned target,
- const Point& offset,
- const Rect& rect) {
+ const gfx::Point& offset,
+ const gfx::Rect& rect) {
return false;
}
-bool GLImageGLX::ScheduleOverlayPlane(AcceleratedWidget widget,
+bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
- OverlayTransform transform,
- const Rect& bounds_rect,
- const RectF& crop_rect) {
+ gfx::OverlayTransform transform,
+ const gfx::Rect& bounds_rect,
+ const gfx::RectF& crop_rect) {
return false;
}
@@ -207,4 +207,4 @@ void GLImageGLX::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
// TODO(ericrk): Implement GLImage OnMemoryDump. crbug.com/514914
}
-} // namespace gfx
+} // namespace gl

Powered by Google App Engine
This is Rietveld 408576698