| Index: ui/gl/gl_image_io_surface.mm
|
| diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
|
| index 3059333cc8896feb96c15f2b4147e3e927a3f417..8a379cfa6c030fa591474e67d718b83491fe5f24 100644
|
| --- a/ui/gl/gl_image_io_surface.mm
|
| +++ b/ui/gl/gl_image_io_surface.mm
|
| @@ -69,6 +69,7 @@ STRINGIZE(
|
| bool ValidInternalFormat(unsigned internalformat) {
|
| switch (internalformat) {
|
| case GL_RED:
|
| + case GL_BGR_EXT:
|
| case GL_BGRA_EXT:
|
| case GL_RGB:
|
| case GL_RGB_YCBCR_420V_CHROMIUM:
|
| @@ -87,6 +88,7 @@ bool ValidFormat(BufferFormat format) {
|
| case BufferFormat::RGBA_8888:
|
| case BufferFormat::UYVY_422:
|
| case BufferFormat::YUV_420_BIPLANAR:
|
| + case BufferFormat::BGRX_8888:
|
| return true;
|
| case BufferFormat::ATC:
|
| case BufferFormat::ATCIA:
|
| @@ -95,7 +97,6 @@ bool ValidFormat(BufferFormat format) {
|
| case BufferFormat::ETC1:
|
| case BufferFormat::RGBA_4444:
|
| case BufferFormat::RGBX_8888:
|
| - case BufferFormat::BGRX_8888:
|
| case BufferFormat::YUV_420:
|
| return false;
|
| }
|
| @@ -110,6 +111,7 @@ GLenum TextureFormat(BufferFormat format) {
|
| return GL_RED;
|
| case BufferFormat::BGRA_8888:
|
| case BufferFormat::RGBA_8888:
|
| + case BufferFormat::BGRX_8888:
|
| return GL_RGBA;
|
| case BufferFormat::UYVY_422:
|
| return GL_RGB;
|
| @@ -122,7 +124,6 @@ GLenum TextureFormat(BufferFormat format) {
|
| case BufferFormat::ETC1:
|
| case BufferFormat::RGBA_4444:
|
| case BufferFormat::RGBX_8888:
|
| - case BufferFormat::BGRX_8888:
|
| case BufferFormat::YUV_420:
|
| NOTREACHED();
|
| return 0;
|
| @@ -138,6 +139,7 @@ GLenum DataFormat(BufferFormat format) {
|
| return GL_RED;
|
| case BufferFormat::BGRA_8888:
|
| case BufferFormat::RGBA_8888:
|
| + case BufferFormat::BGRX_8888:
|
| return GL_BGRA;
|
| case BufferFormat::UYVY_422:
|
| return GL_YCBCR_422_APPLE;
|
| @@ -148,7 +150,6 @@ GLenum DataFormat(BufferFormat format) {
|
| case BufferFormat::ETC1:
|
| case BufferFormat::RGBA_4444:
|
| case BufferFormat::RGBX_8888:
|
| - case BufferFormat::BGRX_8888:
|
| case BufferFormat::YUV_420:
|
| case BufferFormat::YUV_420_BIPLANAR:
|
| NOTREACHED();
|
| @@ -165,6 +166,7 @@ GLenum DataType(BufferFormat format) {
|
| return GL_UNSIGNED_BYTE;
|
| case BufferFormat::BGRA_8888:
|
| case BufferFormat::RGBA_8888:
|
| + case BufferFormat::BGRX_8888:
|
| return GL_UNSIGNED_INT_8_8_8_8_REV;
|
| case BufferFormat::UYVY_422:
|
| return GL_UNSIGNED_SHORT_8_8_APPLE;
|
| @@ -176,7 +178,6 @@ GLenum DataType(BufferFormat format) {
|
| case BufferFormat::ETC1:
|
| case BufferFormat::RGBA_4444:
|
| case BufferFormat::RGBX_8888:
|
| - case BufferFormat::BGRX_8888:
|
| case BufferFormat::YUV_420:
|
| case BufferFormat::YUV_420_BIPLANAR:
|
| NOTREACHED();
|
| @@ -193,7 +194,11 @@ GLImageIOSurface::GLImageIOSurface(const gfx::Size& size,
|
| unsigned internalformat)
|
| : size_(size),
|
| internalformat_(internalformat),
|
| - format_(BufferFormat::RGBA_8888) {}
|
| + desired_internalformat_(internalformat),
|
| + format_(BufferFormat::RGBA_8888) {
|
| + if (internalformat == GL_BGR_EXT)
|
| + internalformat_ = GL_BGRA_EXT;
|
| +}
|
|
|
| GLImageIOSurface::~GLImageIOSurface() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| @@ -405,6 +410,10 @@ void GLImageIOSurface::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
|
| pmd->AddOwnershipEdge(dump->guid(), guid);
|
| }
|
|
|
| +bool GLImageIOSurface::EmulatingRGB() const {
|
| + return desired_internalformat_ == GL_BGR_EXT;
|
| +}
|
| +
|
| base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() {
|
| return io_surface_;
|
| }
|
|
|