Bug 1630481 - make Wrench force external BGRA8 images to known format to avoid needing swizzles. r=kvark

Differential Revision: https://phabricator.services.mozilla.com/D71134
This commit is contained in:
Lee Salzman 2020-04-16 15:13:03 +00:00
Родитель c6bf1adfa6
Коммит cef6b8c8e7
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -3,10 +3,10 @@ root:
items:
- type: rect
bounds: [0, 0, 50, 50]
color: blue
color: red
- type: rect
bounds: [50, 0, 50, 50]
color: red
color: blue
- type: rect
bounds: [0, 50, 50, 50]
color: green

Просмотреть файл

@ -111,7 +111,16 @@ impl LocalExternalImageHandler {
ImageData::Raw(ref data) => {
let gl = device.gl();
let texture_ids = gl.gen_textures(1);
let format_desc = device.gl_describe_format(desc.format);
let format_desc = if desc.format == ImageFormat::BGRA8 {
// Force BGRA8 data to RGBA8 layout to avoid potential
// need for usage of texture-swizzle.
webrender::FormatDesc {
external: gl::BGRA,
.. device.gl_describe_format(ImageFormat::RGBA8)
}
} else {
device.gl_describe_format(desc.format)
};
LocalExternalImageHandler::init_gl_texture(
texture_ids[0],