Commit ab29a5f0 authored by Dongseong Hwang's avatar Dongseong Hwang Committed by Commit Bot

webgl, cros: make chromium image work on ChromeOS.

BGRX_8888 Gpu Memory Buffer is not always supported. Before using it, check it
available first.

BUG=746069
TEST=run WebGL Aquarium on eve

Change-Id: Ib49784a7706cfebd8edd572011c874b18f805f86
Reviewed-on: https://chromium-review.googlesource.com/576616Reviewed-by: default avatarDongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Dongseong Hwang <dongseong.hwang@intel.com>
Cr-Commit-Position: refs/heads/master@{#488374}
parent f5793c4d
include_rules = [
# For tests only!
"+gpu/command_buffer/client/gles2_interface_stub.h",
"+gpu/command_buffer/common/capabilities.h"
"+gpu/command_buffer/common/capabilities.h",
"+gpu/command_buffer/common/gpu_memory_buffer_support.h"
]
......@@ -39,6 +39,7 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "gpu/command_buffer/common/gpu_memory_buffer_support.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/AcceleratedStaticBitmapImage.h"
#include "platform/graphics/GraphicsLayer.h"
......@@ -1178,7 +1179,11 @@ RefPtr<DrawingBuffer::ColorBuffer> DrawingBuffer::CreateColorBuffer(
buffer_format = gfx::BufferFormat::RGBA_8888;
gl_format = GL_RGBA;
} else {
buffer_format = gfx::BufferFormat::BGRX_8888;
buffer_format = gfx::BufferFormat::RGBX_8888;
if (gpu::IsImageFromGpuMemoryBufferFormatSupported(
gfx::BufferFormat::BGRX_8888,
ContextProvider()->GetCapabilities()))
buffer_format = gfx::BufferFormat::BGRX_8888;
gl_format = GL_RGB;
}
gpu_memory_buffer = gpu_memory_buffer_manager->CreateGpuMemoryBuffer(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment