Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GrProcessorAnalysisColor Class Reference

#include <GrProcessorAnalysis.h>

Public Types

enum class  Opaque { kNo , kYes }
 

Public Member Functions

constexpr GrProcessorAnalysisColor (Opaque opaque=Opaque::kNo)
 
 GrProcessorAnalysisColor (const SkPMColor4f &color)
 
void setToConstant (const SkPMColor4f &color)
 
void setToUnknown ()
 
void setToUnknownOpaque ()
 
bool isUnknown () const
 
bool isOpaque () const
 
bool isConstant (SkPMColor4f *color=nullptr) const
 
bool operator== (const GrProcessorAnalysisColor &that) const
 

Static Public Member Functions

static GrProcessorAnalysisColor Combine (const GrProcessorAnalysisColor &a, const GrProcessorAnalysisColor &b)
 

Detailed Description

Definition at line 19 of file GrProcessorAnalysis.h.

Member Enumeration Documentation

◆ Opaque

Enumerator
kNo 
kYes 

Definition at line 21 of file GrProcessorAnalysis.h.

21 {
22 kNo,
23 kYes,
24 };
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.

Constructor & Destructor Documentation

◆ GrProcessorAnalysisColor() [1/2]

constexpr GrProcessorAnalysisColor::GrProcessorAnalysisColor ( Opaque  opaque = Opaque::kNo)
inlineconstexpr

Definition at line 26 of file GrProcessorAnalysis.h.

27 : fFlags(opaque == Opaque::kYes ? kIsOpaque_Flag : 0)
28 , fColor(SK_PMColor4fTRANSPARENT) {}
constexpr SkPMColor4f SK_PMColor4fTRANSPARENT
Definition: SkColorData.h:378

◆ GrProcessorAnalysisColor() [2/2]

GrProcessorAnalysisColor::GrProcessorAnalysisColor ( const SkPMColor4f color)
inline

Definition at line 30 of file GrProcessorAnalysis.h.

30{ this->setToConstant(color); }
void setToConstant(const SkPMColor4f &color)

Member Function Documentation

◆ Combine()

static GrProcessorAnalysisColor GrProcessorAnalysisColor::Combine ( const GrProcessorAnalysisColor a,
const GrProcessorAnalysisColor b 
)
inlinestatic

The returned value reflects the common properties of the two inputs.

Definition at line 67 of file GrProcessorAnalysis.h.

68 {
70 uint32_t commonFlags = a.fFlags & b.fFlags;
71 if ((kColorIsKnown_Flag & commonFlags) && a.fColor == b.fColor) {
72 result.fColor = a.fColor;
73 result.fFlags = a.fFlags;
74 } else if (kIsOpaque_Flag & commonFlags) {
75 result.fFlags = kIsOpaque_Flag;
76 }
77 return result;
78 }
static bool b
struct MyStruct a[10]
GAsyncResult * result

◆ isConstant()

bool GrProcessorAnalysisColor::isConstant ( SkPMColor4f color = nullptr) const
inline

Definition at line 49 of file GrProcessorAnalysis.h.

49 {
50 if (kColorIsKnown_Flag & fFlags) {
51 if (color) {
52 *color = fColor;
53 }
54 return true;
55 }
56 return false;
57 }
DlColor color

◆ isOpaque()

bool GrProcessorAnalysisColor::isOpaque ( ) const
inline

Definition at line 47 of file GrProcessorAnalysis.h.

47{ return SkToBool(kIsOpaque_Flag & fFlags); }
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35

◆ isUnknown()

bool GrProcessorAnalysisColor::isUnknown ( ) const
inline

Definition at line 45 of file GrProcessorAnalysis.h.

45{ return SkToBool(fFlags == 0); }

◆ operator==()

bool GrProcessorAnalysisColor::operator== ( const GrProcessorAnalysisColor that) const
inline

Definition at line 59 of file GrProcessorAnalysis.h.

59 {
60 if (fFlags != that.fFlags) {
61 return false;
62 }
63 return (kColorIsKnown_Flag & fFlags) ? fColor == that.fColor : true;
64 }

◆ setToConstant()

void GrProcessorAnalysisColor::setToConstant ( const SkPMColor4f color)
inline

Definition at line 32 of file GrProcessorAnalysis.h.

32 {
33 fColor = color;
34 if (color.isOpaque()) {
35 fFlags = kColorIsKnown_Flag | kIsOpaque_Flag;
36 } else {
37 fFlags = kColorIsKnown_Flag;
38 }
39 }

◆ setToUnknown()

void GrProcessorAnalysisColor::setToUnknown ( )
inline

Definition at line 41 of file GrProcessorAnalysis.h.

41{ fFlags = 0; }

◆ setToUnknownOpaque()

void GrProcessorAnalysisColor::setToUnknownOpaque ( )
inline

Definition at line 43 of file GrProcessorAnalysis.h.

43{ fFlags = kIsOpaque_Flag; }

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