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

Unified Diff: ui/gl/gl_image_ozone_native_pixmap.cc

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