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

Unified Diff: ui/gl/gl_image_ozone_native_pixmap.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_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 e0d0e372c9eb495104afcbb6b0b90a97610b5be2..3e0cfb513fcf485f428c627562a8b2b78a25c659 100644
--- a/ui/gl/gl_image_ozone_native_pixmap.cc
+++ b/ui/gl/gl_image_ozone_native_pixmap.cc
@@ -26,7 +26,7 @@
}
}
-bool ValidFormat(BufferFormat format) {
+bool ValidFormat(gfx::BufferFormat format) {
switch (format) {
case BufferFormat::RGBA_8888:
case BufferFormat::BGRA_8888:
@@ -49,7 +49,7 @@
return false;
}
-EGLint FourCC(BufferFormat format) {
+EGLint FourCC(gfx::BufferFormat format) {
switch (format) {
case BufferFormat::RGBA_8888:
return DRM_FORMAT_ABGR8888;
@@ -87,12 +87,12 @@
bool GLImageOzoneNativePixmap::Initialize(ui::NativePixmap* pixmap,
BufferFormat format) {
DCHECK(!pixmap_);
+
+ bool result = true;
if (pixmap->GetEGLClientBuffer()) {
EGLint attrs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE};
- if (!GLImageEGL::Initialize(EGL_NATIVE_PIXMAP_KHR,
- pixmap->GetEGLClientBuffer(), attrs)) {
- return false;
- }
+ result = GLImageEGL::Initialize(EGL_NATIVE_PIXMAP_KHR,
+ pixmap->GetEGLClientBuffer(), attrs);
} else if (pixmap->GetDmaBufFd() >= 0) {
if (!ValidInternalFormat(internalformat_)) {
LOG(ERROR) << "Invalid internalformat: " << internalformat_;
@@ -119,14 +119,13 @@
EGL_DMA_BUF_PLANE0_PITCH_EXT,
pixmap->GetDmaBufPitch(),
EGL_NONE};
- if (!GLImageEGL::Initialize(EGL_LINUX_DMA_BUF_EXT,
- static_cast<EGLClientBuffer>(nullptr), attrs)) {
- return false;
- }
+ result = GLImageEGL::Initialize(
+ EGL_LINUX_DMA_BUF_EXT, static_cast<EGLClientBuffer>(nullptr), attrs);
}
- pixmap_ = pixmap;
- return true;
+ if (result)
+ pixmap_ = pixmap;
+ return result;
}
unsigned GLImageOzoneNativePixmap::GetInternalFormat() {
« 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