Commit 183f11ba authored by Brian Salomon's avatar Brian Salomon Committed by Commit Bot

Use SkYUVAInfo's separate plane config and subsampling enums.

Allows removal of combined enum from Skia:
https://skia-review.googlesource.com/c/skia/+/334161

Bug: skia:10632
Change-Id: I6e89110694ba5808d493d9ff0670727f383a2577
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533579
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828528}
parent c70c7db2
...@@ -1950,7 +1950,8 @@ TEST_F(OopPixelTest, ConvertYUVToRGB) { ...@@ -1950,7 +1950,8 @@ TEST_F(OopPixelTest, ConvertYUVToRGB) {
SkYUVAInfo yuva_info( SkYUVAInfo yuva_info(
{options.resource_size.width(), options.resource_size.height()}, {options.resource_size.width(), options.resource_size.height()},
SkYUVAInfo::PlanarConfig::kY_U_V_420, kJPEG_Full_SkYUVColorSpace); SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k420,
kJPEG_Full_SkYUVColorSpace);
GrYUVABackendTextures yuva_textures(yuva_info, backend_textures, GrYUVABackendTextures yuva_textures(yuva_info, backend_textures,
kTopLeft_GrSurfaceOrigin); kTopLeft_GrSurfaceOrigin);
...@@ -2068,7 +2069,8 @@ TEST_F(OopPixelTest, ConvertNV12ToRGB) { ...@@ -2068,7 +2069,8 @@ TEST_F(OopPixelTest, ConvertNV12ToRGB) {
SkYUVAInfo yuva_info( SkYUVAInfo yuva_info(
{options.resource_size.width(), options.resource_size.height()}, {options.resource_size.width(), options.resource_size.height()},
SkYUVAInfo::PlanarConfig::kY_UV_420, kJPEG_Full_SkYUVColorSpace); SkYUVAInfo::PlaneConfig::kY_UV, SkYUVAInfo::Subsampling::k420,
kJPEG_Full_SkYUVColorSpace);
GrYUVABackendTextures yuva_textures(yuva_info, backend_textures, GrYUVABackendTextures yuva_textures(yuva_info, backend_textures,
kTopLeft_GrSurfaceOrigin); kTopLeft_GrSurfaceOrigin);
auto expected_image = SkImage::MakeFromYUVATextures( auto expected_image = SkImage::MakeFromYUVATextures(
......
...@@ -74,7 +74,8 @@ TEST(PaintImageTest, GetSkImageForFrameNotGeneratorBacked) { ...@@ -74,7 +74,8 @@ TEST(PaintImageTest, GetSkImageForFrameNotGeneratorBacked) {
TEST(PaintImageTest, DecodeToYuv420NoAlpha) { TEST(PaintImageTest, DecodeToYuv420NoAlpha) {
const SkISize full_size = SkISize::Make(10, 10); const SkISize full_size = SkISize::Make(10, 10);
SkYUVAInfo yuva_info(full_size, SkYUVAInfo::PlanarConfig::kY_U_V_420, SkYUVAInfo yuva_info(full_size, SkYUVAInfo::PlaneConfig::kY_U_V,
SkYUVAInfo::Subsampling::k420,
kJPEG_Full_SkYUVColorSpace); kJPEG_Full_SkYUVColorSpace);
SkYUVAPixmapInfo yuva_pixmap_info(yuva_info, SkYUVAPixmapInfo yuva_pixmap_info(yuva_info,
SkYUVAPixmapInfo::DataType::kUnorm8, SkYUVAPixmapInfo::DataType::kUnorm8,
......
...@@ -109,22 +109,32 @@ SkYUVAPixmapInfo GetYUVAPixmapInfo(const gfx::Size& image_size, ...@@ -109,22 +109,32 @@ SkYUVAPixmapInfo GetYUVAPixmapInfo(const gfx::Size& image_size,
NOTREACHED(); NOTREACHED();
return SkYUVAPixmapInfo(); return SkYUVAPixmapInfo();
} }
SkYUVAInfo::PlanarConfig planar_config; SkYUVAInfo::Subsampling subsampling;
switch (format) { switch (format) {
case YUVSubsampling::k410:
subsampling = SkYUVAInfo::Subsampling::k410;
break;
case YUVSubsampling::k411:
subsampling = SkYUVAInfo::Subsampling::k411;
break;
case YUVSubsampling::k420: case YUVSubsampling::k420:
planar_config = SkYUVAInfo::PlanarConfig::kY_U_V_420; subsampling = SkYUVAInfo::Subsampling::k420;
break; break;
case YUVSubsampling::k422: case YUVSubsampling::k422:
planar_config = SkYUVAInfo::PlanarConfig::kY_U_V_422; subsampling = SkYUVAInfo::Subsampling::k422;
break;
case YUVSubsampling::k440:
subsampling = SkYUVAInfo::Subsampling::k440;
break; break;
case YUVSubsampling::k444: case YUVSubsampling::k444:
planar_config = SkYUVAInfo::PlanarConfig::kY_U_V_444; subsampling = SkYUVAInfo::Subsampling::k444;
break; break;
default: default:
NOTREACHED(); NOTREACHED();
return SkYUVAPixmapInfo(); return SkYUVAPixmapInfo();
} }
SkYUVAInfo yuva_info({image_size.width(), image_size.height()}, planar_config, SkYUVAInfo yuva_info({image_size.width(), image_size.height()},
SkYUVAInfo::PlaneConfig::kY_U_V, subsampling,
kJPEG_Full_SkYUVColorSpace); kJPEG_Full_SkYUVColorSpace);
return SkYUVAPixmapInfo(yuva_info, yuv_data_type, /*row bytes*/ nullptr); return SkYUVAPixmapInfo(yuva_info, yuv_data_type, /*row bytes*/ nullptr);
} }
......
This diff is collapsed.
...@@ -520,10 +520,7 @@ class CC_EXPORT GpuImageDecodeCache ...@@ -520,10 +520,7 @@ class CC_EXPORT GpuImageDecodeCache
bool is_bitmap_backed, bool is_bitmap_backed,
bool can_do_hardware_accelerated_decode, bool can_do_hardware_accelerated_decode,
bool do_hardware_accelerated_decode, bool do_hardware_accelerated_decode,
bool is_yuv_format, base::Optional<SkYUVAPixmapInfo> yuva_pixmap_info);
SkYUVColorSpace yuv_cs,
SkYUVAInfo::PlanarConfig yuv_config,
SkYUVAPixmapInfo::DataType yuv_dt);
bool IsGpuOrTransferCache() const; bool IsGpuOrTransferCache() const;
bool HasUploadedData() const; bool HasUploadedData() const;
...@@ -537,11 +534,8 @@ class CC_EXPORT GpuImageDecodeCache ...@@ -537,11 +534,8 @@ class CC_EXPORT GpuImageDecodeCache
int upload_scale_mip_level; int upload_scale_mip_level;
bool needs_mips = false; bool needs_mips = false;
bool is_bitmap_backed; bool is_bitmap_backed;
bool is_yuv;
bool is_budgeted = false; bool is_budgeted = false;
base::Optional<SkYUVColorSpace> yuv_color_space; base::Optional<SkYUVAPixmapInfo> yuva_pixmap_info;
base::Optional<SkYUVAInfo::PlanarConfig> yuv_planar_config;
base::Optional<SkYUVAPixmapInfo::DataType> yuv_data_type;
// If true, this image is no longer in our |persistent_cache_| and will be // If true, this image is no longer in our |persistent_cache_| and will be
// deleted as soon as its ref count reaches zero. // deleted as soon as its ref count reaches zero.
...@@ -642,7 +636,8 @@ class CC_EXPORT GpuImageDecodeCache ...@@ -642,7 +636,8 @@ class CC_EXPORT GpuImageDecodeCache
const SkImage* uploaded_v_image, const SkImage* uploaded_v_image,
const size_t image_width, const size_t image_width,
const size_t image_height, const size_t image_height,
const SkYUVAInfo::PlanarConfig yuva_planar_config, const SkYUVAInfo::PlaneConfig yuva_plane_config,
const SkYUVAInfo::Subsampling yuva_subsampling,
const SkYUVColorSpace yuva_color_space, const SkYUVColorSpace yuva_color_space,
sk_sp<SkColorSpace> target_color_space, sk_sp<SkColorSpace> target_color_space,
sk_sp<SkColorSpace> decoded_color_space) const; sk_sp<SkColorSpace> decoded_color_space) const;
......
...@@ -2737,10 +2737,11 @@ void RasterDecoderImpl::DoConvertYUVMailboxesToRGBINTERNAL( ...@@ -2737,10 +2737,11 @@ void RasterDecoderImpl::DoConvertYUVMailboxesToRGBINTERNAL(
SkISize dest_size = SkISize dest_size =
SkISize::Make(dest_surface->width(), dest_surface->height()); SkISize::Make(dest_surface->width(), dest_surface->height());
SkYUVAInfo::PlanarConfig planar_config = SkYUVAInfo::PlaneConfig plane_config =
is_nv12 ? SkYUVAInfo::PlanarConfig::kY_UV_420 is_nv12 ? SkYUVAInfo::PlaneConfig::kY_UV
: SkYUVAInfo::PlanarConfig::kY_U_V_420; : SkYUVAInfo::PlaneConfig::kY_U_V;
SkYUVAInfo yuva_info(dest_size, planar_config, src_color_space); SkYUVAInfo yuva_info(dest_size, plane_config, SkYUVAInfo::Subsampling::k420,
src_color_space);
GrYUVABackendTextures yuva_backend_textures(yuva_info, yuva_textures.data(), GrYUVABackendTextures yuva_backend_textures(yuva_info, yuva_textures.data(),
kTopLeft_GrSurfaceOrigin); kTopLeft_GrSurfaceOrigin);
auto result_image = auto result_image =
......
...@@ -638,31 +638,24 @@ bool ValidFormatForDirectUploading(GrGLenum format, unsigned int type) { ...@@ -638,31 +638,24 @@ bool ValidFormatForDirectUploading(GrGLenum format, unsigned int type) {
} }
} }
bool VideoPixelFormatAsSkYUVAInfoPlanarConfig( std::tuple<SkYUVAInfo::PlaneConfig, SkYUVAInfo::Subsampling>
VideoPixelFormat format, VideoPixelFormatAsSkYUVAInfoValues(VideoPixelFormat format) {
SkYUVAInfo::PlanarConfig* config) {
// TODO(skbug.com/10632): Add more formats, e.g. I420A, NV12, NV21 when Skia
// equivalents are added.
// The 9, 10, and 12 bit formats could be added here if GetYUVAPlanes() were // The 9, 10, and 12 bit formats could be added here if GetYUVAPlanes() were
// updated to convert data to unorm16/float16. // updated to convert data to unorm16/float16. Similarly, alpha planes and
// formats with interleaved planes (e.g. NV12) could be supported if that
// function were updated to not assume 3 separate Y, U, and V planes. Also,
// GpuImageDecodeCache would need be able to handle plane configurations
// other than 3 separate y, u, and v planes (crbug.com/910276).
switch (format) { switch (format) {
case PIXEL_FORMAT_I420: case PIXEL_FORMAT_I420:
if (config) { return {SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k420};
*config = SkYUVAInfo::PlanarConfig::kY_U_V_420;
}
return true;
case PIXEL_FORMAT_I422: case PIXEL_FORMAT_I422:
if (config) { return {SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k422};
*config = SkYUVAInfo::PlanarConfig::kY_U_V_422;
}
return true;
case PIXEL_FORMAT_I444: case PIXEL_FORMAT_I444:
if (config) { return {SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k444};
*config = SkYUVAInfo::PlanarConfig::kY_U_V_444;
}
return true;
default: default:
return false; return {SkYUVAInfo::PlaneConfig::kUnknown,
SkYUVAInfo::Subsampling::kUnknown};
} }
} }
...@@ -704,9 +697,11 @@ class VideoImageGenerator : public cc::PaintImageGenerator { ...@@ -704,9 +697,11 @@ class VideoImageGenerator : public cc::PaintImageGenerator {
// is added for VideoImageGenerator. // is added for VideoImageGenerator.
return false; return false;
#if 0 #if 0
SkYUVAInfo::PlanarConfig planar_config; SkYUVAInfo::PlaneConfig plane_config;
if (!VideoPixelFormatAsSkYUVAInfoPlanarConfig(frame_->format(), SkYUVAInfo::Subsampling subsampling;
&planar_config)) { std::tie(plane_config, subsampling) =
VideoPixelFormatAsSkYUVAInfoValues(frame_->format());
if (plane_config == SkYUVAInfo::PlaneConfig::kUnknown) {
return false; return false;
} }
if (info) { if (info) {
...@@ -722,8 +717,9 @@ class VideoImageGenerator : public cc::PaintImageGenerator { ...@@ -722,8 +717,9 @@ class VideoImageGenerator : public cc::PaintImageGenerator {
VideoFrame::PlaneSize(frame_->format(), VideoFrame::kYPlane, VideoFrame::PlaneSize(frame_->format(), VideoFrame::kYPlane,
gfx::Size(frame_->visible_rect().width(), gfx::Size(frame_->visible_rect().width(),
frame_->visible_rect().height())); frame_->visible_rect().height()));
SkYUVAInfo yuva_info = SkYUVAInfo({y_size.width(), y_size.height()}, SkYUVAInfo yuva_info =
planar_config, yuv_color_space); SkYUVAInfo({y_size.width(), y_size.height()}, plane_config,
subsampling, yuv_color_space);
*info = SkYUVAPixmapInfo(yuva_info, SkYUVAPixmapInfo::DataType::kUnorm8, *info = SkYUVAPixmapInfo(yuva_info, SkYUVAPixmapInfo::DataType::kUnorm8,
/* row bytes */ nullptr); /* row bytes */ nullptr);
} }
...@@ -735,13 +731,15 @@ class VideoImageGenerator : public cc::PaintImageGenerator { ...@@ -735,13 +731,15 @@ class VideoImageGenerator : public cc::PaintImageGenerator {
size_t frame_index, size_t frame_index,
uint32_t lazy_pixel_ref) override { uint32_t lazy_pixel_ref) override {
DCHECK_EQ(frame_index, 0u); DCHECK_EQ(frame_index, 0u);
DCHECK_EQ(pixmaps.numPlanes(), 3);
if (!VideoPixelFormatAsSkYUVAInfoPlanarConfig(frame_->format(), nullptr)) {
return false; if (DCHECK_IS_ON()) {
} SkYUVAInfo::PlaneConfig plane_config;
SkYUVAInfo::Subsampling subsampling;
if (!pixmaps.plane(3).dimensions().isEmpty()) { std::tie(plane_config, subsampling) =
return false; VideoPixelFormatAsSkYUVAInfoValues(frame_->format());
DCHECK_EQ(plane_config, pixmaps.yuvaInfo().planeConfig());
DCHECK_EQ(subsampling, pixmaps.yuvaInfo().subsampling());
} }
for (int plane = VideoFrame::kYPlane; plane <= VideoFrame::kVPlane; for (int plane = VideoFrame::kYPlane; plane <= VideoFrame::kVPlane;
......
...@@ -40,20 +40,24 @@ sk_sp<SkImage> YUVGrBackendTexturesToSkImage( ...@@ -40,20 +40,24 @@ sk_sp<SkImage> YUVGrBackendTexturesToSkImage(
VideoPixelFormat video_format, VideoPixelFormat video_format,
GrBackendTexture* yuv_textures, GrBackendTexture* yuv_textures,
const GrBackendTexture& result_texture) { const GrBackendTexture& result_texture) {
SkYUVAInfo::PlanarConfig planar_config; SkYUVAInfo::PlaneConfig plane_config;
SkYUVAInfo::Subsampling subsampling;
switch (video_format) { switch (video_format) {
case PIXEL_FORMAT_NV12: case PIXEL_FORMAT_NV12:
planar_config = SkYUVAInfo::PlanarConfig::kY_UV_420; plane_config = SkYUVAInfo::PlaneConfig::kY_UV;
subsampling = SkYUVAInfo::Subsampling::k420;
break; break;
case PIXEL_FORMAT_I420: case PIXEL_FORMAT_I420:
planar_config = SkYUVAInfo::PlanarConfig::kY_U_V_420; plane_config = SkYUVAInfo::PlaneConfig::kY_U_V;
subsampling = SkYUVAInfo::Subsampling::k420;
break; break;
default: default:
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
SkYUVColorSpace color_space = ColorSpaceToSkYUVColorSpace(video_color_space); SkYUVColorSpace color_space = ColorSpaceToSkYUVColorSpace(video_color_space);
SkYUVAInfo yuva_info(result_texture.dimensions(), planar_config, color_space); SkYUVAInfo yuva_info(result_texture.dimensions(), plane_config, subsampling,
color_space);
GrYUVABackendTextures yuva_backend_textures(yuva_info, yuv_textures, GrYUVABackendTextures yuva_backend_textures(yuva_info, yuv_textures,
kTopLeft_GrSurfaceOrigin); kTopLeft_GrSurfaceOrigin);
return SkImage::MakeFromYUVATexturesCopyToExternal( return SkImage::MakeFromYUVATexturesCopyToExternal(
...@@ -115,13 +119,16 @@ bool YUVGrBackendTexturesToSkSurface(GrDirectContext* gr_context, ...@@ -115,13 +119,16 @@ bool YUVGrBackendTexturesToSkSurface(GrDirectContext* gr_context,
sk_sp<SkSurface> surface, sk_sp<SkSurface> surface,
bool flip_y, bool flip_y,
bool use_visible_rect) { bool use_visible_rect) {
SkYUVAInfo::PlanarConfig planar_config; SkYUVAInfo::PlaneConfig plane_config;
SkYUVAInfo::Subsampling subsampling;
switch (video_frame->format()) { switch (video_frame->format()) {
case PIXEL_FORMAT_NV12: case PIXEL_FORMAT_NV12:
planar_config = SkYUVAInfo::PlanarConfig::kY_UV_420; plane_config = SkYUVAInfo::PlaneConfig::kY_UV;
subsampling = SkYUVAInfo::Subsampling::k420;
break; break;
case PIXEL_FORMAT_I420: case PIXEL_FORMAT_I420:
planar_config = SkYUVAInfo::PlanarConfig::kY_U_V_420; plane_config = SkYUVAInfo::PlaneConfig::kY_U_V;
subsampling = SkYUVAInfo::Subsampling::k420;
break; break;
default: default:
NOTREACHED(); NOTREACHED();
...@@ -129,7 +136,8 @@ bool YUVGrBackendTexturesToSkSurface(GrDirectContext* gr_context, ...@@ -129,7 +136,8 @@ bool YUVGrBackendTexturesToSkSurface(GrDirectContext* gr_context,
} }
SkYUVAInfo yuva_info( SkYUVAInfo yuva_info(
{video_frame->coded_size().width(), video_frame->coded_size().height()}, {video_frame->coded_size().width(), video_frame->coded_size().height()},
planar_config, ColorSpaceToSkYUVColorSpace(video_frame->ColorSpace())); plane_config, subsampling,
ColorSpaceToSkYUVColorSpace(video_frame->ColorSpace()));
auto image = SkImage::MakeFromYUVATextures( auto image = SkImage::MakeFromYUVATextures(
gr_context, gr_context,
GrYUVABackendTextures(yuva_info, yuv_textures, kTopLeft_GrSurfaceOrigin), GrYUVABackendTextures(yuva_info, yuv_textures, kTopLeft_GrSurfaceOrigin),
......
...@@ -38,32 +38,36 @@ ...@@ -38,32 +38,36 @@
namespace blink { namespace blink {
static bool UpdateYUVAInfoPlanarConfigAndWidthBytes( SkYUVAInfo::Subsampling SubsamplingToSkiaSubsampling(
ImageDecoder* decoder, cc::YUVSubsampling subsampling) {
SkYUVAInfo::PlanarConfig* config, switch (subsampling) {
size_t component_width_bytes[SkYUVAInfo::kMaxPlanes]) {
switch (decoder->GetYUVSubsampling()) {
case cc::YUVSubsampling::k410: case cc::YUVSubsampling::k410:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_410; return SkYUVAInfo::Subsampling::k410;
break;
case cc::YUVSubsampling::k411: case cc::YUVSubsampling::k411:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_411; return SkYUVAInfo::Subsampling::k411;
break;
case cc::YUVSubsampling::k420: case cc::YUVSubsampling::k420:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_420; return SkYUVAInfo::Subsampling::k420;
break;
case cc::YUVSubsampling::k422: case cc::YUVSubsampling::k422:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_422; return SkYUVAInfo::Subsampling::k422;
break;
case cc::YUVSubsampling::k440: case cc::YUVSubsampling::k440:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_440; return SkYUVAInfo::Subsampling::k440;
break;
case cc::YUVSubsampling::k444: case cc::YUVSubsampling::k444:
*config = SkYUVAInfo::PlanarConfig::kY_U_V_444; return SkYUVAInfo::Subsampling::k444;
break; case cc::YUVSubsampling::kUnknown:
default: return SkYUVAInfo::Subsampling::kUnknown;
return false; }
}
static bool UpdateYUVAInfoSubsamplingAndWidthBytes(
ImageDecoder* decoder,
SkYUVAInfo::Subsampling* subsampling,
size_t component_width_bytes[SkYUVAInfo::kMaxPlanes]) {
SkYUVAInfo::Subsampling tempSubsampling =
SubsamplingToSkiaSubsampling(decoder->GetYUVSubsampling());
if (tempSubsampling == SkYUVAInfo::Subsampling::kUnknown) {
return false;
} }
*subsampling = tempSubsampling;
component_width_bytes[0] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kY); component_width_bytes[0] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kY);
component_width_bytes[1] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kU); component_width_bytes[1] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kU);
component_width_bytes[2] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kV); component_width_bytes[2] = decoder->DecodedYUVWidthBytes(cc::YUVIndex::kV);
...@@ -253,26 +257,29 @@ bool ImageFrameGenerator::GetYUVAInfo( ...@@ -253,26 +257,29 @@ bool ImageFrameGenerator::GetYUVAInfo(
DCHECK(decoder); DCHECK(decoder);
DCHECK(decoder->CanDecodeToYUV()); DCHECK(decoder->CanDecodeToYUV());
SkYUVAInfo::PlanarConfig config; SkYUVAInfo::Subsampling subsampling;
size_t width_bytes[SkYUVAInfo::kMaxPlanes]; size_t width_bytes[SkYUVAInfo::kMaxPlanes];
if (!UpdateYUVAInfoPlanarConfigAndWidthBytes(decoder.get(), &config, if (!UpdateYUVAInfoSubsamplingAndWidthBytes(decoder.get(), &subsampling,
width_bytes)) { width_bytes)) {
return false; return false;
} }
SkYUVAInfo yuva_info(full_size_, config, decoder->GetYUVColorSpace()); SkYUVAInfo yuva_info(full_size_, SkYUVAInfo::PlaneConfig::kY_U_V, subsampling,
decoder->GetYUVColorSpace());
SkYUVAPixmapInfo::DataType dataType; SkYUVAPixmapInfo::DataType dataType;
if (decoder->GetYUVBitDepth() > 8) { if (decoder->GetYUVBitDepth() > 8) {
if (supported_data_types.supported(config, if (supported_data_types.supported(SkYUVAInfo::PlaneConfig::kY_U_V,
SkYUVAPixmapInfo::DataType::kUnorm16)) { SkYUVAPixmapInfo::DataType::kUnorm16)) {
dataType = SkYUVAPixmapInfo::DataType::kUnorm16; dataType = SkYUVAPixmapInfo::DataType::kUnorm16;
} else if (supported_data_types.supported( } else if (supported_data_types.supported(
config, SkYUVAPixmapInfo::DataType::kFloat16)) { SkYUVAInfo::PlaneConfig::kY_U_V,
SkYUVAPixmapInfo::DataType::kFloat16)) {
dataType = SkYUVAPixmapInfo::DataType::kFloat16; dataType = SkYUVAPixmapInfo::DataType::kFloat16;
} else { } else {
return false; return false;
} }
} else if (supported_data_types.supported( } else if (supported_data_types.supported(
config, SkYUVAPixmapInfo::DataType::kUnorm8)) { SkYUVAInfo::PlaneConfig::kY_U_V,
SkYUVAPixmapInfo::DataType::kUnorm8)) {
dataType = SkYUVAPixmapInfo::DataType::kUnorm8; dataType = SkYUVAPixmapInfo::DataType::kUnorm8;
} else { } else {
return false; return false;
......
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