Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RuntimeEffectRPCallbacks Class Reference

#include <SkRuntimeEffectPriv.h>

Inheritance diagram for RuntimeEffectRPCallbacks:
SkSL::RP::Callbacks

Public Member Functions

 RuntimeEffectRPCallbacks (const SkStageRec &s, const SkShaders::MatrixRec &m, SkSpan< const SkRuntimeEffect::ChildPtr > c, SkSpan< const SkSL::SampleUsage > u)
 
bool appendShader (int index) override
 
bool appendColorFilter (int index) override
 
bool appendBlender (int index) override
 
void toLinearSrgb (const void *color) override
 
void fromLinearSrgb (const void *color) override
 
- Public Member Functions inherited from SkSL::RP::Callbacks
virtual ~Callbacks ()=default
 

Detailed Description

Definition at line 181 of file SkRuntimeEffectPriv.h.

Constructor & Destructor Documentation

◆ RuntimeEffectRPCallbacks()

RuntimeEffectRPCallbacks::RuntimeEffectRPCallbacks ( const SkStageRec s,
const SkShaders::MatrixRec m,
SkSpan< const SkRuntimeEffect::ChildPtr c,
SkSpan< const SkSL::SampleUsage u 
)
inline

Definition at line 186 of file SkRuntimeEffectPriv.h.

190 : fStage{s.fPipeline,
191 s.fAlloc,
192 s.fDstColorType,
193 s.fDstCS,
195 s.fSurfaceProps}
196 , fMatrix(m)
197 , fChildren(c)
198 , fSampleUsages(u) {}
struct MyStruct s
constexpr SkColor4f kTransparent
Definition SkColor.h:434

Member Function Documentation

◆ appendBlender()

bool RuntimeEffectRPCallbacks::appendBlender ( int  index)
overridevirtual

Implements SkSL::RP::Callbacks.

Definition at line 306 of file SkRuntimeEffect.cpp.

306 {
307 if (SkBlender* blender = fChildren[index].blender()) {
308 return as_BB(blender)->appendStages(fStage);
309 }
310 // Return a source-over blend when a null blender is evaluated.
311 fStage.fPipeline->append(SkRasterPipelineOp::srcover);
312 return true;
313}
SkBlenderBase * as_BB(SkBlender *blend)
bool appendStages(const SkStageRec &rec) const
void append(SkRasterPipelineOp, void *=nullptr)
SkRasterPipeline * fPipeline

◆ appendColorFilter()

bool RuntimeEffectRPCallbacks::appendColorFilter ( int  index)
overridevirtual

Implements SkSL::RP::Callbacks.

Definition at line 299 of file SkRuntimeEffect.cpp.

299 {
300 if (SkColorFilter* colorFilter = fChildren[index].colorFilter()) {
301 return as_CFB(colorFilter)->appendStages(fStage, /*shaderIsOpaque=*/false);
302 }
303 // Return the original color as-is when a null child color filter is evaluated.
304 return true;
305}
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
virtual bool appendStages(const SkStageRec &rec, bool shaderIsOpaque) const =0

◆ appendShader()

bool RuntimeEffectRPCallbacks::appendShader ( int  index)
overridevirtual

Implements SkSL::RP::Callbacks.

Definition at line 284 of file SkRuntimeEffect.cpp.

284 {
285 if (SkShader* shader = fChildren[index].shader()) {
286 if (fSampleUsages[index].isPassThrough()) {
287 // Given a passthrough sample, the total-matrix is still as valid as before.
288 return as_SB(shader)->appendStages(fStage, fMatrix);
289 }
290 // For a non-passthrough sample, we need to explicitly mark the total-matrix as invalid.
291 SkShaders::MatrixRec nonPassthroughMatrix = fMatrix;
292 nonPassthroughMatrix.markTotalMatrixInvalid();
293 return as_SB(shader)->appendStages(fStage, nonPassthroughMatrix);
294 }
295 // Return transparent black when a null shader is evaluated.
297 return true;
298}
SkShaderBase * as_SB(SkShader *shader)
void appendConstantColor(SkArenaAlloc *, const float rgba[4])
virtual bool appendStages(const SkStageRec &, const SkShaders::MatrixRec &) const =0
SkArenaAlloc * fAlloc

◆ fromLinearSrgb()

void RuntimeEffectRPCallbacks::fromLinearSrgb ( const void *  color)
overridevirtual

Implements SkSL::RP::Callbacks.

Definition at line 328 of file SkRuntimeEffect.cpp.

328 {
329 if (fStage.fDstCS) {
332 if (xform.flags.mask()) {
333 // We have a non-identity colorspace transform; apply it.
334 this->applyColorSpaceXform(xform, color);
335 }
336 }
337}
SkColor4f color
kUnpremul_SkAlphaType
SkColorSpace * sk_srgb_linear_singleton()
SkColorSpace * fDstCS

◆ toLinearSrgb()

void RuntimeEffectRPCallbacks::toLinearSrgb ( const void *  color)
overridevirtual

Implements SkSL::RP::Callbacks.

Definition at line 317 of file SkRuntimeEffect.cpp.

317 {
318 if (fStage.fDstCS) {
321 if (xform.flags.mask()) {
322 // We have a non-identity colorspace transform; apply it.
323 this->applyColorSpaceXform(xform, color);
324 }
325 }
326}

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