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

Unified Diff: ui/gl/gl_image_ozone_native_pixmap.cc

Issue 1269503007: Unify graphics buffer format & usage enums for GpuMemoryBuffer & SurfaceFactoryOzone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header to BUILD.gn Created 5 years, 4 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_ozone_native_pixmap.h ('k') | ui/gl/gl_image_ref_counted_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_ozone_native_pixmap.cc
diff --git a/ui/gl/gl_image_ozone_native_pixmap.cc b/ui/gl/gl_image_ozone_native_pixmap.cc
index 30518b9207a88d8f4348eff5076dbd8ac03f9d00..90cc2205fad8cfed77f22500de681c744b40dfcc 100644
--- a/ui/gl/gl_image_ozone_native_pixmap.cc
+++ b/ui/gl/gl_image_ozone_native_pixmap.cc
@@ -24,20 +24,20 @@ bool ValidInternalFormat(unsigned internalformat) {
}
}
-bool ValidFormat(gfx::GpuMemoryBuffer::Format format) {
+bool ValidFormat(gfx::BufferFormat format) {
switch (format) {
- case GpuMemoryBuffer::BGRA_8888:
- case GpuMemoryBuffer::RGBX_8888:
+ case BufferFormat::BGRA_8888:
+ case BufferFormat::RGBX_8888:
return true;
- case GpuMemoryBuffer::ATC:
- case GpuMemoryBuffer::ATCIA:
- case GpuMemoryBuffer::DXT1:
- case GpuMemoryBuffer::DXT5:
- case GpuMemoryBuffer::ETC1:
- case GpuMemoryBuffer::R_8:
- case GpuMemoryBuffer::RGBA_4444:
- case GpuMemoryBuffer::RGBA_8888:
- case GpuMemoryBuffer::YUV_420:
+ case BufferFormat::ATC:
+ case BufferFormat::ATCIA:
+ case BufferFormat::DXT1:
+ case BufferFormat::DXT5:
+ case BufferFormat::ETC1:
+ case BufferFormat::R_8:
+ case BufferFormat::RGBA_4444:
+ case BufferFormat::RGBA_8888:
+ case BufferFormat::YUV_420:
return false;
}
@@ -45,21 +45,21 @@ bool ValidFormat(gfx::GpuMemoryBuffer::Format format) {
return false;
}
-EGLint FourCC(gfx::GpuMemoryBuffer::Format format) {
+EGLint FourCC(gfx::BufferFormat format) {
switch (format) {
- case GpuMemoryBuffer::BGRA_8888:
+ case BufferFormat::BGRA_8888:
return DRM_FORMAT_ARGB8888;
- case GpuMemoryBuffer::RGBX_8888:
+ case BufferFormat::RGBX_8888:
return DRM_FORMAT_XRGB8888;
- case GpuMemoryBuffer::ATC:
- case GpuMemoryBuffer::ATCIA:
- case GpuMemoryBuffer::DXT1:
- case GpuMemoryBuffer::DXT5:
- case GpuMemoryBuffer::ETC1:
- case GpuMemoryBuffer::R_8:
- case GpuMemoryBuffer::RGBA_4444:
- case GpuMemoryBuffer::RGBA_8888:
- case GpuMemoryBuffer::YUV_420:
+ case BufferFormat::ATC:
+ case BufferFormat::ATCIA:
+ case BufferFormat::DXT1:
+ case BufferFormat::DXT5:
+ case BufferFormat::ETC1:
+ case BufferFormat::R_8:
+ case BufferFormat::RGBA_4444:
+ case BufferFormat::RGBA_8888:
+ case BufferFormat::YUV_420:
NOTREACHED();
return 0;
}
@@ -79,7 +79,7 @@ GLImageOzoneNativePixmap::~GLImageOzoneNativePixmap() {
}
bool GLImageOzoneNativePixmap::Initialize(ui::NativePixmap* pixmap,
- GpuMemoryBuffer::Format format) {
+ BufferFormat format) {
DCHECK(!pixmap_);
bool result = true;
@@ -94,7 +94,7 @@ bool GLImageOzoneNativePixmap::Initialize(ui::NativePixmap* pixmap,
}
if (!ValidFormat(format)) {
- LOG(ERROR) << "Invalid format: " << format;
+ LOG(ERROR) << "Invalid format: " << static_cast<int>(format);
return false;
}
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.h ('k') | ui/gl/gl_image_ref_counted_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698