Flutter Engine
The Flutter Engine
Classes | Static Public Member Functions | List of all members
skgpu::graphite::YUVImageShaderBlock Struct Reference

#include <KeyHelpers.h>

Classes

struct  ImageData
 

Static Public Member Functions

static void AddBlock (const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, const ImageData &)
 

Detailed Description

Definition at line 194 of file KeyHelpers.h.

Member Function Documentation

◆ AddBlock()

void skgpu::graphite::YUVImageShaderBlock::AddBlock ( const KeyContext keyContext,
PaintParamsKeyBuilder builder,
PipelineDataGatherer gatherer,
const ImageData imgData 
)
static

Definition at line 804 of file KeyHelpers.cpp.

807 {
808 if (keyContext.recorder() &&
809 (!imgData.fTextureProxies[0] || !imgData.fTextureProxies[1] ||
810 !imgData.fTextureProxies[2] || !imgData.fTextureProxies[3])) {
812 return;
813 }
814
815 const Caps* caps = keyContext.caps();
816 const bool doTilingInHw = !imgData.fSampling.useCubic && can_do_yuv_tiling_in_hw(caps, imgData);
817
818 SkTileMode uvTileModes[2] = { imgData.fTileModes[0] == SkTileMode::kDecal
819 ? SkTileMode::kClamp : imgData.fTileModes[0],
820 imgData.fTileModes[1] == SkTileMode::kDecal
821 ? SkTileMode::kClamp : imgData.fTileModes[1] };
822 gatherer->add(imgData.fTextureProxies[0], {imgData.fSampling, imgData.fTileModes});
823 gatherer->add(imgData.fTextureProxies[1], {imgData.fSamplingUV, uvTileModes});
824 gatherer->add(imgData.fTextureProxies[2], {imgData.fSamplingUV, uvTileModes});
825 gatherer->add(imgData.fTextureProxies[3], {imgData.fSampling, imgData.fTileModes});
826
827 if (doTilingInHw) {
828 add_hw_yuv_image_uniform_data(keyContext.dict(), imgData, gatherer);
830 } else if (imgData.fSampling.useCubic) {
831 add_cubic_yuv_image_uniform_data(keyContext.dict(), imgData, gatherer);
833 } else {
834 add_yuv_image_uniform_data(keyContext.dict(), imgData, gatherer);
836 }
837}
SkTileMode
Definition: SkTileMode.h:13
static bool can_do_yuv_tiling_in_hw(const Caps *caps, const YUVImageShaderBlock::ImageData &imgData)
Definition: KeyHelpers.cpp:784

The documentation for this struct was generated from the following files: