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() { |