Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrCoordTransform Class Reference

A class representing a linear transformation from one of the built-in coordinate sets (local or position). More...

#include <GrCoordTransform.h>

Inheritance diagram for GrCoordTransform:

Public Member Functions

 GrCoordTransform (GrCoordSet sourceCoords, const GrTexture *texture, GrTextureParams::FilterMode filter)
 Create a transformation that maps [0, 1] to a texture's boundaries. More...
 
 GrCoordTransform (GrCoordSet sourceCoords, const SkMatrix &m, const GrTexture *texture, GrTextureParams::FilterMode filter)
 Create a transformation from a matrix. More...
 
 GrCoordTransform (GrCoordSet sourceCoords, const SkMatrix &m, GrSLPrecision precision=kDefault_GrSLPrecision)
 Create a transformation that applies the matrix to a coord set.
 
void reset (GrCoordSet sourceCoords, const GrTexture *texture, GrTextureParams::FilterMode filter)
 
void reset (GrCoordSet, const SkMatrix &, const GrTexture *, GrTextureParams::FilterMode filter)
 
void reset (GrCoordSet sourceCoords, const SkMatrix &m, GrSLPrecision precision=kDefault_GrSLPrecision)
 
GrCoordTransformoperator= (const GrCoordTransform &that)
 
SkMatrixaccessMatrix ()
 Access the matrix for editing. More...
 
bool operator== (const GrCoordTransform &that) const
 
bool operator!= (const GrCoordTransform &that) const
 
GrCoordSet sourceCoords () const
 
const SkMatrixgetMatrix () const
 
bool reverseY () const
 
GrSLPrecision precision () const
 

Static Public Member Functions

static SkMatrix MakeDivByTextureWHMatrix (const GrTexture *texture)
 Useful for effects that want to insert a texture matrix that is implied by the texture dimensions.
 

Private Types

typedef SkNoncopyable INHERITED
 

Private Attributes

GrCoordSet fSourceCoords
 
SkMatrix fMatrix
 
bool fReverseY
 
GrSLPrecision fPrecision
 

Detailed Description

A class representing a linear transformation from one of the built-in coordinate sets (local or position).

GrProcessors just define these transformations, and the framework does the rest of the work to make the transformed coordinates available in their fragment shader.

Constructor & Destructor Documentation

GrCoordTransform::GrCoordTransform ( GrCoordSet  sourceCoords,
const GrTexture texture,
GrTextureParams::FilterMode  filter 
)
inline

Create a transformation that maps [0, 1] to a texture's boundaries.

The precision is inferred from the texture size and filter. The texture origin also implies whether a y-reversal should be performed.

GrCoordTransform::GrCoordTransform ( GrCoordSet  sourceCoords,
const SkMatrix m,
const GrTexture texture,
GrTextureParams::FilterMode  filter 
)
inline

Create a transformation from a matrix.

The precision is inferred from the texture size and filter. The texture origin also implies whether a y-reversal should be performed.

Member Function Documentation

SkMatrix* GrCoordTransform::accessMatrix ( )
inline

Access the matrix for editing.

Note, this must be done before adding the transform to an effect, since effects are immutable.


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