Flutter Engine
The Flutter Engine
Classes | Static Public Member Functions | List of all members
skgpu::graphite::ImageShaderBlock 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 165 of file KeyHelpers.h.

Member Function Documentation

◆ AddBlock()

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

Definition at line 673 of file KeyHelpers.cpp.

676 {
677
678 if (keyContext.recorder() && !imgData.fTextureProxy) {
680 return;
681 }
682
683 const Caps* caps = keyContext.caps();
684 const bool doTilingInHw = !imgData.fSampling.useCubic && can_do_tiling_in_hw(caps, imgData);
685
686 if (doTilingInHw) {
687 add_hw_image_uniform_data(keyContext.dict(), imgData, gatherer);
689 } else if (imgData.fSampling.useCubic) {
690 add_cubic_image_uniform_data(keyContext.dict(), imgData, gatherer);
692 } else {
693 add_image_uniform_data(keyContext.dict(), imgData, gatherer);
695 }
696
697 static constexpr SkTileMode kDefaultTileModes[2] = {SkTileMode::kClamp, SkTileMode::kClamp};
698
699 // Image shaders must append immutable sampler data (or '0' in the more common case where
700 // regular samplers are used).
701 ImmutableSamplerInfo info = caps->getImmutableSamplerInfo(imgData.fTextureProxy.get());
702 SamplerDesc samplerDesc {imgData.fSampling,
703 doTilingInHw ? imgData.fTileModes : kDefaultTileModes,
704 info};
705 gatherer->add(imgData.fTextureProxy, samplerDesc);
706 add_sampler_data_to_key(builder, samplerDesc);
707}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
SkTileMode
Definition: SkTileMode.h:13

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