Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
SkSurfaceProps Class Reference

#include <SkSurfaceProps.h>

Public Types

enum  Flags { kDefault_Flag = 0 , kUseDeviceIndependentFonts_Flag = 1 << 0 , kDynamicMSAA_Flag = 1 << 1 , kAlwaysDither_Flag = 1 << 2 }
 

Public Member Functions

 SkSurfaceProps ()
 
 SkSurfaceProps (uint32_t flags, SkPixelGeometry)
 
 SkSurfaceProps (uint32_t flags, SkPixelGeometry, SkScalar textContrast, SkScalar textGamma)
 
 SkSurfaceProps (const SkSurfaceProps &)=default
 
SkSurfacePropsoperator= (const SkSurfaceProps &)=default
 
SkSurfaceProps cloneWithPixelGeometry (SkPixelGeometry newPixelGeometry) const
 
uint32_t flags () const
 
SkPixelGeometry pixelGeometry () const
 
SkScalar textContrast () const
 
SkScalar textGamma () const
 
bool isUseDeviceIndependentFonts () const
 
bool isAlwaysDither () const
 
bool operator== (const SkSurfaceProps &that) const
 
bool operator!= (const SkSurfaceProps &that) const
 

Static Public Attributes

static constexpr SkScalar kMaxContrastInclusive = 1
 
static constexpr SkScalar kMinContrastInclusive = 0
 
static constexpr SkScalar kMaxGammaExclusive = 4
 
static constexpr SkScalar kMinGammaInclusive = 0
 

Detailed Description

Describes properties and constraints of a given SkSurface. The rendering engine can parse these during drawing, and can sometimes optimize its performance (e.g. disabling an expensive feature).

Definition at line 53 of file SkSurfaceProps.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kDefault_Flag 
kUseDeviceIndependentFonts_Flag 
kDynamicMSAA_Flag 
kAlwaysDither_Flag 

Definition at line 55 of file SkSurfaceProps.h.

55 {
56 kDefault_Flag = 0,
58 // Use internal MSAA to render to non-MSAA GPU surfaces.
59 kDynamicMSAA_Flag = 1 << 1,
60 // If set, all rendering will have dithering enabled
61 // Currently this only impacts GPU backends
62 kAlwaysDither_Flag = 1 << 2,
63 };
@ kUseDeviceIndependentFonts_Flag

Constructor & Destructor Documentation

◆ SkSurfaceProps() [1/4]

SkSurfaceProps::SkSurfaceProps ( )

No flags, unknown pixel geometry, platform-default contrast/gamma.

Definition at line 37 of file SkSurface.cpp.

38 : fFlags(0)
39 , fPixelGeometry(kUnknown_SkPixelGeometry)
40 , fTextContrast(SK_GAMMA_CONTRAST)
41 , fTextGamma(SK_GAMMA_EXPONENT) {}
@ kUnknown_SkPixelGeometry
#define SK_GAMMA_CONTRAST
Definition SkTypes.h:94
#define SK_GAMMA_EXPONENT
Definition SkTypes.h:86

◆ SkSurfaceProps() [2/4]

SkSurfaceProps::SkSurfaceProps ( uint32_t  flags,
SkPixelGeometry  pg 
)

TODO(kschmi): Remove this constructor and replace with the one below.

Definition at line 43 of file SkSurface.cpp.

44 : fFlags(flags)
45 , fPixelGeometry(pg)
46 , fTextContrast(SK_GAMMA_CONTRAST)
47 , fTextGamma(SK_GAMMA_EXPONENT) {}
uint32_t flags() const

◆ SkSurfaceProps() [3/4]

SkSurfaceProps::SkSurfaceProps ( uint32_t  flags,
SkPixelGeometry  pg,
SkScalar  textContrast,
SkScalar  textGamma 
)

Specified pixel geometry, text contrast, and gamma

Definition at line 49 of file SkSurface.cpp.

53 : fFlags(flags), fPixelGeometry(pg), fTextContrast(textContrast), fTextGamma(textGamma) {}
SkScalar textGamma() const
SkScalar textContrast() const

◆ SkSurfaceProps() [4/4]

SkSurfaceProps::SkSurfaceProps ( const SkSurfaceProps )
default

Member Function Documentation

◆ cloneWithPixelGeometry()

SkSurfaceProps SkSurfaceProps::cloneWithPixelGeometry ( SkPixelGeometry  newPixelGeometry) const
inline

Definition at line 75 of file SkSurfaceProps.h.

75 {
76 return SkSurfaceProps(fFlags, newPixelGeometry, fTextContrast, fTextGamma);
77 }

◆ flags()

uint32_t SkSurfaceProps::flags ( ) const
inline

Definition at line 84 of file SkSurfaceProps.h.

84{ return fFlags; }

◆ isAlwaysDither()

bool SkSurfaceProps::isAlwaysDither ( ) const
inline

Definition at line 93 of file SkSurfaceProps.h.

93 {
94 return SkToBool(fFlags & kAlwaysDither_Flag);
95 }
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35

◆ isUseDeviceIndependentFonts()

bool SkSurfaceProps::isUseDeviceIndependentFonts ( ) const
inline

Definition at line 89 of file SkSurfaceProps.h.

89 {
91 }

◆ operator!=()

bool SkSurfaceProps::operator!= ( const SkSurfaceProps that) const
inline

Definition at line 102 of file SkSurfaceProps.h.

102 {
103 return !(*this == that);
104 }

◆ operator=()

SkSurfaceProps & SkSurfaceProps::operator= ( const SkSurfaceProps )
default

◆ operator==()

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

Definition at line 97 of file SkSurfaceProps.h.

97 {
98 return fFlags == that.fFlags && fPixelGeometry == that.fPixelGeometry &&
99 fTextContrast == that.fTextContrast && fTextGamma == that.fTextGamma;
100 }

◆ pixelGeometry()

SkPixelGeometry SkSurfaceProps::pixelGeometry ( ) const
inline

Definition at line 85 of file SkSurfaceProps.h.

85{ return fPixelGeometry; }

◆ textContrast()

SkScalar SkSurfaceProps::textContrast ( ) const
inline

Definition at line 86 of file SkSurfaceProps.h.

86{ return fTextContrast; }

◆ textGamma()

SkScalar SkSurfaceProps::textGamma ( ) const
inline

Definition at line 87 of file SkSurfaceProps.h.

87{ return fTextGamma; }

Member Data Documentation

◆ kMaxContrastInclusive

constexpr SkScalar SkSurfaceProps::kMaxContrastInclusive = 1
staticconstexpr

Definition at line 79 of file SkSurfaceProps.h.

◆ kMaxGammaExclusive

constexpr SkScalar SkSurfaceProps::kMaxGammaExclusive = 4
staticconstexpr

Definition at line 81 of file SkSurfaceProps.h.

◆ kMinContrastInclusive

constexpr SkScalar SkSurfaceProps::kMinContrastInclusive = 0
staticconstexpr

Definition at line 80 of file SkSurfaceProps.h.

◆ kMinGammaInclusive

constexpr SkScalar SkSurfaceProps::kMinGammaInclusive = 0
staticconstexpr

Definition at line 82 of file SkSurfaceProps.h.


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