Flutter Engine
The Flutter Engine
Classes | Functions
GrDefaultGeoProcFactory Namespace Reference

Classes

struct  Color
 
struct  Coverage
 
struct  LocalCoords
 

Functions

GrGeometryProcessorMake (SkArenaAlloc *, const Color &, const Coverage &, const LocalCoords &, const SkMatrix &viewMatrix)
 
GrGeometryProcessorMakeForDeviceSpace (SkArenaAlloc *, const Color &, const Coverage &, const LocalCoords &, const SkMatrix &viewMatrix)
 

Function Documentation

◆ Make()

GrGeometryProcessor * GrDefaultGeoProcFactory::Make ( SkArenaAlloc arena,
const Color color,
const Coverage coverage,
const LocalCoords localCoords,
const SkMatrix viewMatrix 
)

Definition at line 295 of file GrDefaultGeoProcFactory.cpp.

299 {
300 uint32_t flags = 0;
301 if (Color::kPremulGrColorAttribute_Type == color.fType) {
303 } else if (Color::kPremulWideColorAttribute_Type == color.fType) {
305 }
306 if (Coverage::kAttribute_Type == coverage.fType) {
308 } else if (Coverage::kAttributeTweakAlpha_Type == coverage.fType) {
310 } else if (Coverage::kAttributeUnclamped_Type == coverage.fType) {
312 }
313 flags |= localCoords.fType == LocalCoords::kHasExplicit_Type ? kLocalCoordAttribute_GPFlag : 0;
314
315 uint8_t inCoverage = coverage.fCoverage;
316 bool localCoordsWillBeRead = localCoords.fType != LocalCoords::kUnused_Type;
317
318 return DefaultGeoProc::Make(arena,
319 flags,
320 color.fColor,
321 viewMatrix,
322 localCoords.fMatrix ? *localCoords.fMatrix : SkMatrix::I(),
323 localCoordsWillBeRead,
324 inCoverage);
325}
@ kCoverageAttributeUnclamped_GPFlag
@ kCoverageAttribute_GPFlag
@ kColorAttribute_GPFlag
@ kCoverageAttributeTweak_GPFlag
@ kLocalCoordAttribute_GPFlag
@ kColorAttributeIsWide_GPFlag
static GrGeometryProcessor * Make(SkArenaAlloc *arena, uint32_t gpTypeFlags, const SkPMColor4f &color, const SkMatrix &viewMatrix, const SkMatrix &localMatrix, bool localCoordsWillBeRead, uint8_t coverage)
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
DlColor color
FlutterSemanticsFlag flags

◆ MakeForDeviceSpace()

GrGeometryProcessor * GrDefaultGeoProcFactory::MakeForDeviceSpace ( SkArenaAlloc arena,
const Color color,
const Coverage coverage,
const LocalCoords localCoords,
const SkMatrix viewMatrix 
)

Definition at line 327 of file GrDefaultGeoProcFactory.cpp.

331 {
333 if (LocalCoords::kUnused_Type != localCoords.fType) {
334 SkASSERT(LocalCoords::kUsePosition_Type == localCoords.fType);
335 if (!viewMatrix.isIdentity() && !viewMatrix.invert(&invert)) {
336 return nullptr;
337 }
338
339 if (localCoords.hasLocalMatrix()) {
340 invert.postConcat(*localCoords.fMatrix);
341 }
342 }
343
344 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert);
345 return Make(arena, color, coverage, inverted, SkMatrix::I());
346}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool invert(SkMatrix *inverse) const
Definition: SkMatrix.h:1206
bool isIdentity() const
Definition: SkMatrix.h:223
gboolean invert
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)