Skia
2DGraphicsLibrary
|
Public Member Functions | |
bool | copySurface (GrSurface *src, const SkIRect &srcRect, const SkIPoint &dstPoint) |
virtual void | drawText (const GrClip &, const GrPaint &, const SkPaint &, const SkMatrix &viewMatrix, const char text[], size_t byteLength, SkScalar x, SkScalar y, const SkIRect &clipBounds) |
virtual void | drawPosText (const GrClip &, const GrPaint &, const SkPaint &, const SkMatrix &viewMatrix, const char text[], size_t byteLength, const SkScalar pos[], int scalarsPerPosition, const SkPoint &offset, const SkIRect &clipBounds) |
virtual void | drawTextBlob (const GrClip &, const SkPaint &, const SkMatrix &viewMatrix, const SkTextBlob *, SkScalar x, SkScalar y, SkDrawFilter *, const SkIRect &clipBounds) |
void | discard () |
Provides a perfomance hint that the render target's contents are allowed to become undefined. | |
void | clear (const SkIRect *rect, GrColor color, bool canIgnoreRect) |
Clear the entire or rect of the render target, ignoring any clips. More... | |
void | drawPaint (const GrClip &, const GrPaint &, const SkMatrix &viewMatrix) |
Draw everywhere (respecting the clip) with the paint. | |
void | drawRect (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &, const GrStyle *style=nullptr) |
Draw the rect using a paint. More... | |
void | fillRectToRect (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &rectToDraw, const SkRect &localRect) |
Maps a rectangle of shader coordinates to a rectangle and fills that rectangle. More... | |
void | fillRectWithLocalMatrix (const GrClip &clip, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &rect, const SkMatrix &localMatrix) |
Fills a rect with a paint and a localMatrix. | |
void | drawRRect (const GrClip &, const GrPaint &, const SkMatrix &viewMatrix, const SkRRect &rrect, const GrStyle &style) |
Draw a roundrect using a paint. More... | |
void | drawDRRect (const GrClip &, const GrPaint &, const SkMatrix &viewMatrix, const SkRRect &outer, const SkRRect &inner) |
Shortcut for drawing an SkPath consisting of nested rrects using a paint. More... | |
void | drawPath (const GrClip &, const GrPaint &, const SkMatrix &viewMatrix, const SkPath &, const GrStyle &style) |
Draws a path. More... | |
void | drawVertices (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, GrPrimitiveType primitiveType, int vertexCount, const SkPoint positions[], const SkPoint texs[], const GrColor colors[], const uint16_t indices[], int indexCount) |
Draws vertices with a paint. More... | |
void | drawAtlas (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, int spriteCount, const SkRSXform xform[], const SkRect texRect[], const SkColor colors[]) |
Draws textured sprites from an atlas with a paint. More... | |
void | drawOval (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &oval, const GrStyle &style) |
Draws an oval. More... | |
void | drawArc (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const GrStyle &style) |
Draws a partial arc of an oval. More... | |
void | drawImageLattice (const GrClip &, const GrPaint &paint, const SkMatrix &viewMatrix, int imageWidth, int imageHeight, std::unique_ptr< SkLatticeIter > iter, const SkRect &dst) |
Draw the image as a set of rects, specified by |iter|. | |
void | prepareForExternalIO () |
After this returns any pending surface IO will be issued to the backend 3D API and if the surface has MSAA it will be resolved. | |
bool | isStencilBufferMultisampled () const |
bool | isUnifiedMultisampled () const |
bool | hasMixedSamples () const |
bool | mustUseHWAA (const GrPaint &paint) const |
const GrSurfaceDesc & | desc () const |
int | width () const |
int | height () const |
GrPixelConfig | config () const |
int | numColorSamples () const |
bool | isGammaCorrect () const |
SkSourceGammaTreatment | sourceGammaTreatment () const |
const SkSurfaceProps & | surfaceProps () const |
SkColorSpace * | getColorSpace () const |
GrSurfaceOrigin | origin () const |
bool | wasAbandoned () const |
GrRenderTarget * | accessRenderTarget () |
sk_sp< GrRenderTarget > | renderTarget () |
sk_sp< GrTexture > | asTexture () |
GrDrawContextPriv | drawContextPriv () |
const GrDrawContextPriv | drawContextPriv () const |
GrAuditTrail * | auditTrail () |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
Default construct, initializing the reference count to 1. | |
virtual | ~SkRefCntBase () |
Destruct, asserting that the reference count is 1. | |
int32_t | getRefCnt () const |
Return the reference count. More... | |
void | validate () const |
bool | unique () const |
May return true if the caller is the only owner. More... | |
void | ref () const |
Increment the reference count. More... | |
void | unref () const |
Decrement the reference count. More... | |
Protected Member Functions | |
GrDrawContext (GrContext *, GrDrawingManager *, sk_sp< GrRenderTarget >, sk_sp< SkColorSpace >, const SkSurfaceProps *surfaceProps, GrAuditTrail *, GrSingleOwner *) | |
GrDrawingManager * | drawingManager () |
SkDEBUGCODE (GrSingleOwner *singleOwner(){return fSingleOwner;}) SkDEBUGCODE(void validate() const | |
Protected Member Functions inherited from SkRefCntBase | |
void | internal_dispose_restore_refcnt_to_1 () const |
Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More... | |
Private Member Functions | |
bool | drawFilledDRRect (const GrClip &clip, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRRect &origOuter, const SkRRect &origInner) |
bool | drawFilledRect (const GrClip &clip, const GrPaint &paint, const SkMatrix &viewMatrix, const SkRect &rect, const GrUserStencilSettings *ss) |
void | drawNonAAFilledRect (const GrClip &, const GrPaint &, const SkMatrix &viewMatrix, const SkRect &rect, const SkRect *localRect, const SkMatrix *localMatrix, const GrUserStencilSettings *ss, bool useHWAA) |
void | internalDrawPath (const GrClip &clip, const GrPaint &paint, const SkMatrix &viewMatrix, const SkPath &path, const GrStyle &style) |
void | drawBatch (const GrPipelineBuilder &pipelineBuilder, const GrClip &, GrDrawBatch *batch) |
GrDrawTarget * | getDrawTarget () |
Private Attributes | |
GrDrawingManager * | fDrawingManager |
sk_sp< GrRenderTarget > | fRenderTarget |
GrDrawTarget * | fDrawTarget |
GrContext * | fContext |
GrInstancedPipelineInfo | fInstancedPipelineInfo |
sk_sp< SkColorSpace > | fColorSpace |
SkSurfaceProps | fSurfaceProps |
GrAuditTrail * | fAuditTrail |
void GrDrawContext::clear | ( | const SkIRect * | rect, |
GrColor | color, | ||
bool | canIgnoreRect | ||
) |
Clear the entire or rect of the render target, ignoring any clips.
rect | the rect to clear or the whole thing if rect is NULL. |
color | the color to clear to. |
canIgnoreRect | allows partial clears to be converted to whole clears on platforms for which that is cheap |
void GrDrawContext::drawArc | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
const SkRect & | oval, | ||
SkScalar | startAngle, | ||
SkScalar | sweepAngle, | ||
bool | useCenter, | ||
const GrStyle & | style | ||
) |
Draws a partial arc of an oval.
paint | describes how to color pixels. |
viewMatrix | transformation matrix. |
oval | the bounding rect of the oval. |
startAngle | starting angle in degrees. |
sweepAngle | angle to sweep in degrees. Must be in (-360, 360) |
useCenter | true means that the implied path begins at the oval center, connects as a line to the point indicated by the start contains the arc indicated by the sweep angle. If false the line beginning at the center point is omitted. |
style | style to apply to the oval. |
void GrDrawContext::drawAtlas | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
int | spriteCount, | ||
const SkRSXform | xform[], | ||
const SkRect | texRect[], | ||
const SkColor | colors[] | ||
) |
Draws textured sprites from an atlas with a paint.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
spriteCount | number of sprites. |
xform | array of compressed transformation data, required. |
texRect | array of texture rectangles used to access the paint. |
colors | optional array of per-sprite colors, supercedes the paint's color field. |
void GrDrawContext::drawDRRect | ( | const GrClip & | , |
const GrPaint & | , | ||
const SkMatrix & | viewMatrix, | ||
const SkRRect & | outer, | ||
const SkRRect & | inner | ||
) |
Shortcut for drawing an SkPath consisting of nested rrects using a paint.
Does not support stroking. The result is undefined if outer does not contain inner.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
outer | the outer roundrect |
inner | the inner roundrect |
void GrDrawContext::drawOval | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
const SkRect & | oval, | ||
const GrStyle & | style | ||
) |
Draws an oval.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
oval | the bounding rect of the oval. |
style | style to apply to the oval. Currently path effects are not allowed. |
void GrDrawContext::drawPath | ( | const GrClip & | , |
const GrPaint & | , | ||
const SkMatrix & | viewMatrix, | ||
const SkPath & | , | ||
const GrStyle & | style | ||
) |
Draws a path.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
path | the path to draw |
style | style to apply to the path. |
void GrDrawContext::drawRect | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
const SkRect & | , | ||
const GrStyle * | style = nullptr |
||
) |
Draw the rect using a paint.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
style | The style to apply. Null means fill. Currently path effects are not allowed. The rects coords are used to access the paint (through texture matrix) |
void GrDrawContext::drawRRect | ( | const GrClip & | , |
const GrPaint & | , | ||
const SkMatrix & | viewMatrix, | ||
const SkRRect & | rrect, | ||
const GrStyle & | style | ||
) |
Draw a roundrect using a paint.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
rrect | the roundrect to draw |
style | style to apply to the rrect. Currently path effects are not allowed. |
void GrDrawContext::drawVertices | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
GrPrimitiveType | primitiveType, | ||
int | vertexCount, | ||
const SkPoint | positions[], | ||
const SkPoint | texs[], | ||
const GrColor | colors[], | ||
const uint16_t | indices[], | ||
int | indexCount | ||
) |
Draws vertices with a paint.
paint | describes how to color pixels. |
viewMatrix | transformation matrix |
primitiveType | primitives type to draw. |
vertexCount | number of vertices. |
positions | array of vertex positions, required. |
texCoords | optional array of texture coordinates used to access the paint. |
colors | optional array of per-vertex colors, supercedes the paint's color field. |
indices | optional array of indices. If NULL vertices are drawn non-indexed. |
indexCount | if indices is non-null then this is the number of indices. |
void GrDrawContext::fillRectToRect | ( | const GrClip & | , |
const GrPaint & | paint, | ||
const SkMatrix & | viewMatrix, | ||
const SkRect & | rectToDraw, | ||
const SkRect & | localRect | ||
) |
Maps a rectangle of shader coordinates to a rectangle and fills that rectangle.
paint | describes how to color pixels. |
viewMatrix | transformation matrix which applies to rectToDraw |
rectToDraw | the rectangle to draw |
localRect | the rectangle of shader coordinates applied to rectToDraw |