Bug 1362049 - Add R8G8 type in SurfaceFormat. r=bas.schouten

This R8G8 format will be used in NV12 image format.

MozReview-Commit-ID: KNJFwOasVts
This commit is contained in:
JerryShih 2017-05-18 22:59:06 +08:00
parent d39b6f432c
commit 3774d02876
2 changed files with 4 additions and 0 deletions

View File

@ -56,6 +56,8 @@ enum class SurfaceFormat : int8_t {
// This one is a single-byte, so endianness isn't an issue. // This one is a single-byte, so endianness isn't an issue.
A8, A8,
R8G8,
// These ones are their own special cases. // These ones are their own special cases.
YUV, YUV,
NV12, NV12,

View File

@ -60,6 +60,8 @@ SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat) {
return Some(WrImageFormat::RGB8); return Some(WrImageFormat::RGB8);
case gfx::SurfaceFormat::A8: case gfx::SurfaceFormat::A8:
return Some(WrImageFormat::A8); return Some(WrImageFormat::A8);
case gfx::SurfaceFormat::R8G8:
return Some(WrImageFormat::RG8);
case gfx::SurfaceFormat::UNKNOWN: case gfx::SurfaceFormat::UNKNOWN:
return Some(WrImageFormat::Invalid); return Some(WrImageFormat::Invalid);
default: default: