8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED
11 #include "SkBlendMode.h"
15 #include "SkRasterHandleAllocator.h"
16 #include "SkSurfaceProps.h"
19 class GrRenderTargetContext;
27 struct SkDrawShadowRec;
60 enum PrivateSaveLayerFlags {
61 kDontClipToLayer_PrivateSaveLayerFlag = 1U << 31,
80 static std::unique_ptr<SkCanvas> MakeRasterDirect(
const SkImageInfo& info,
void* pixels,
83 static std::unique_ptr<SkCanvas> MakeRasterDirectN32(
int width,
int height,
SkPMColor* pixels,
105 explicit SkCanvas(SkBaseDevice* device);
113 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
114 enum class ColorBehavior {
164 virtual SkISize getBaseLayerSize()
const;
198 SkRasterHandleAllocator::Handle accessTopRasterHandle()
const;
232 bool readPixels(
const SkImageInfo& dstInfo,
void* dstPixels,
size_t dstRowBytes,
234 bool readPixels(
const SkPixmap& pixmap,
int srcX,
int srcY);
235 bool readPixels(
const SkBitmap& bitmap,
int srcX,
int srcY);
255 bool writePixels(
const SkImageInfo& info,
const void* pixels,
size_t rowBytes,
int x,
int y);
261 bool writePixels(
const SkBitmap& bitmap,
int x,
int y);
290 return this->saveLayer(&bounds, paint);
298 int saveLayerPreserveLCDTextRequests(
const SkRect* bounds,
const SkPaint* paint);
311 int saveLayerAlpha(
const SkRect* bounds,
U8CPU alpha);
314 kIsOpaque_SaveLayerFlag = 1 << 0,
315 kPreserveLCDText_SaveLayerFlag = 1 << 1,
318 kInitWithPrevious_SaveLayerFlag = 1 << 2,
320 #ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
321 kDontClipToLayer_Legacy_SaveLayerFlag = kDontClipToLayer_PrivateSaveLayerFlag,
324 typedef uint32_t SaveLayerFlags;
331 , fSaveLayerFlags(saveLayerFlags)
334 SaveLayerFlags saveLayerFlags)
337 , fBackdrop(backdrop)
338 , fSaveLayerFlags(saveLayerFlags)
344 SaveLayerFlags saveLayerFlags)
347 , fBackdrop(backdrop)
348 , fClipMask(clipMask)
349 , fClipMatrix(clipMatrix)
350 , fSaveLayerFlags(saveLayerFlags)
353 const SkRect* fBounds =
nullptr;
354 const SkPaint* fPaint =
nullptr;
356 const SkImage* fClipMask =
nullptr;
357 const SkMatrix* fClipMatrix =
nullptr;
358 SaveLayerFlags fSaveLayerFlags = 0;
374 int getSaveCount()
const;
382 void restoreToCount(
int saveCount);
388 void translate(SkScalar dx, SkScalar dy);
394 void scale(SkScalar sx, SkScalar sy);
399 void rotate(SkScalar degrees);
406 void rotate(SkScalar degrees, SkScalar px, SkScalar py);
412 void skew(SkScalar sx, SkScalar sy);
417 void concat(
const SkMatrix& matrix);
422 void setMatrix(
const SkMatrix& matrix);
434 void clipRect(
const SkRect& rect, SkClipOp op,
bool doAntiAlias);
435 void clipRect(
const SkRect& rect, SkClipOp op) {
436 this->clipRect(rect, op,
false);
438 void clipRect(
const SkRect& rect,
bool doAntiAlias =
false) {
439 this->clipRect(rect, SkClipOp::kIntersect, doAntiAlias);
451 void androidFramework_setDeviceClipRestriction(
const SkIRect& rect);
459 void clipRRect(
const SkRRect& rrect, SkClipOp op,
bool doAntiAlias);
460 void clipRRect(
const SkRRect& rrect, SkClipOp op) {
461 this->clipRRect(rrect, op,
false);
463 void clipRRect(
const SkRRect& rrect,
bool doAntiAlias =
false) {
464 this->clipRRect(rrect, SkClipOp::kIntersect, doAntiAlias);
473 void clipPath(
const SkPath& path, SkClipOp op,
bool doAntiAlias);
474 void clipPath(
const SkPath& path, SkClipOp op) {
475 this->clipPath(path, op,
false);
477 void clipPath(
const SkPath& path,
bool doAntiAlias =
false) {
478 this->clipPath(path, SkClipOp::kIntersect, doAntiAlias);
485 fAllowSimplifyClip = allow;
495 void clipRegion(
const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect);
505 bool quickReject(
const SkRect& rect)
const;
517 bool quickReject(
const SkPath& path)
const;
529 *bounds = this->onGetLocalClipBounds();
543 *bounds = this->onGetDeviceClipBounds();
552 void drawColor(
SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver);
559 this->drawColor(color, SkBlendMode::kSrc);
581 void drawPaint(
const SkPaint& paint);
613 void drawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint);
617 void drawPoint(SkScalar x, SkScalar y,
const SkPaint& paint);
619 this->drawPoint(p.x(), p.y(), paint);
631 void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1,
const SkPaint& paint);
633 this->drawLine(p0.x(), p0.y(), p1.x(), p1.y(), paint);
651 this->drawRect(r, paint);
690 void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius,
const SkPaint& paint);
691 void drawCircle(
SkPoint center, SkScalar radius,
const SkPaint& paint) {
692 this->drawCircle(center.x(), center.y(), radius, paint);
709 void drawArc(
const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle,
710 bool useCenter,
const SkPaint& paint);
719 void drawRoundRect(
const SkRect& rect, SkScalar rx, SkScalar ry,
const SkPaint& paint);
736 void drawImage(
const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint = NULL);
737 void drawImage(
const sk_sp<SkImage>& image, SkScalar left, SkScalar top,
739 this->drawImage(image.get(), left, top, paint);
784 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
788 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
791 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
795 SrcRectConstraint constraint = kStrict_SrcRectConstraint) {
796 this->drawImageRect(image.get(), src, dst, paint, constraint);
800 SrcRectConstraint constraint = kStrict_SrcRectConstraint) {
801 this->drawImageRect(image.get(), isrc, dst, paint, constraint);
804 SrcRectConstraint constraint = kStrict_SrcRectConstraint) {
805 this->drawImageRect(image.get(), dst, paint, constraint);
823 const SkPaint* paint =
nullptr);
825 const SkPaint* paint =
nullptr) {
826 this->drawImageNine(image.get(), center, dst, paint);
845 void drawBitmap(
const SkBitmap& bitmap, SkScalar left, SkScalar top,
861 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
865 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
867 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
893 enum Flags : uint8_t {
895 kTransparent_Flags = 1 << 0,
945 const SkPaint* paint =
nullptr);
947 const SkPaint* paint =
nullptr);
957 void drawText(
const void* text,
size_t byteLength, SkScalar x, SkScalar y,
971 this->drawText(
string, strlen(
string), x, y, paint);
981 void drawString(
const SkString&
string, SkScalar x, SkScalar y,
const SkPaint& paint);
990 void drawPosText(
const void* text,
size_t byteLength,
const SkPoint pos[],
1002 void drawPosTextH(
const void* text,
size_t byteLength,
const SkScalar xpos[], SkScalar constY,
1017 void drawTextOnPathHV(
const void* text,
size_t byteLength,
const SkPath& path, SkScalar hOffset,
1018 SkScalar vOffset,
const SkPaint& paint);
1030 void drawTextOnPath(
const void* text,
size_t byteLength,
const SkPath& path,
1038 void drawTextRSXform(
const void* text,
size_t byteLength,
const SkRSXform xform[],
1047 void drawTextBlob(
const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint);
1049 this->drawTextBlob(blob.get(), x, y, paint);
1059 this->drawPicture(picture, NULL, NULL);
1062 this->drawPicture(picture.get());
1079 this->drawPicture(picture.get(), matrix, paint);
1090 void drawVertices(
const SkVertices* vertices, SkBlendMode mode,
const SkPaint& paint);
1106 void drawPatch(
const SkPoint cubics[12],
const SkColor colors[4],
1107 const SkPoint texCoords[4], SkBlendMode mode,
const SkPaint& paint);
1108 void drawPatch(
const SkPoint cubics[12],
const SkColor colors[4],
1110 this->drawPatch(cubics, colors, texCoords, SkBlendMode::kModulate, paint);
1131 const SkColor colors[],
int count, SkBlendMode mode,
const SkRect* cullRect,
1134 const SkColor colors[],
int count, SkBlendMode mode,
const SkRect* cullRect,
1136 this->drawAtlas(atlas.get(), xform, tex, colors, count, mode, cullRect, paint);
1140 this->drawAtlas(atlas, xform, tex,
nullptr, count, SkBlendMode::kDst, cullRect, paint);
1144 this->drawAtlas(atlas.get(), xform, tex,
nullptr, count, SkBlendMode::kDst,
1157 void drawDrawable(
SkDrawable* drawable, SkScalar x, SkScalar y);
1169 void drawAnnotation(
const SkRect& rect,
const char key[],
SkData* value);
1171 this->drawAnnotation(rect, key, value.get());
1176 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER
1202 virtual bool isClipEmpty()
const;
1208 virtual bool isClipRect()
const;
1214 const SkMatrix& getTotalMatrix()
const;
1219 GrRenderTargetContext* internal_private_accessTopLayerRenderTargetContext();
1222 static void Internal_Private_SetIgnoreSaveLayerBounds(
bool);
1223 static bool Internal_Private_GetIgnoreSaveLayerBounds();
1224 static void Internal_Private_SetTreatSpriteAsBitmap(
bool);
1225 static bool Internal_Private_GetTreatSpriteAsBitmap();
1230 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
1233 SrcRectConstraint constraint = kStrict_SrcRectConstraint);
1239 void temporary_internal_getRgnClip(
SkRegion* region);
1241 void private_draw_shadow_rec(
const SkPath&,
const SkDrawShadowRec&);
1248 virtual bool onPeekPixels(
SkPixmap* pixmap);
1249 virtual bool onAccessTopLayerPixels(
SkPixmap* pixmap);
1252 virtual void onFlush();
1257 enum SaveLayerStrategy {
1258 kFullLayer_SaveLayerStrategy,
1259 kNoLayer_SaveLayerStrategy,
1262 virtual void willSave() {}
1264 virtual SaveLayerStrategy getSaveLayerStrategy(
const SaveLayerRec& ) {
1265 return kFullLayer_SaveLayerStrategy;
1267 virtual void willRestore() {}
1268 virtual void didRestore() {}
1269 virtual void didConcat(
const SkMatrix& ) {}
1270 virtual void didSetMatrix(
const SkMatrix& ) {}
1271 virtual void didTranslate(SkScalar dx, SkScalar dy) {
1272 this->didConcat(SkMatrix::MakeTrans(dx, dy));
1275 virtual SkRect onGetLocalClipBounds()
const;
1276 virtual SkIRect onGetDeviceClipBounds()
const;
1279 virtual void onDrawAnnotation(
const SkRect& rect,
const char key[],
SkData* value);
1282 virtual void onDrawText(
const void* text,
size_t byteLength, SkScalar x,
1283 SkScalar y,
const SkPaint& paint);
1285 virtual void onDrawPosText(
const void* text,
size_t byteLength,
1288 virtual void onDrawPosTextH(
const void* text,
size_t byteLength,
1289 const SkScalar xpos[], SkScalar constY,
1292 virtual void onDrawTextOnPath(
const void* text,
size_t byteLength,
1295 virtual void onDrawTextRSXform(
const void* text,
size_t byteLength,
const SkRSXform xform[],
1298 virtual void onDrawTextBlob(
const SkTextBlob* blob, SkScalar x, SkScalar y,
1301 virtual void onDrawPatch(
const SkPoint cubics[12],
const SkColor colors[4],
1302 const SkPoint texCoords[4], SkBlendMode mode,
const SkPaint& paint);
1306 virtual void onDrawPaint(
const SkPaint& paint);
1307 virtual void onDrawRect(
const SkRect& rect,
const SkPaint& paint);
1308 virtual void onDrawRegion(
const SkRegion& region,
const SkPaint& paint);
1309 virtual void onDrawOval(
const SkRect& rect,
const SkPaint& paint);
1310 virtual void onDrawArc(
const SkRect& rect, SkScalar startAngle, SkScalar sweepAngle,
1311 bool useCenter,
const SkPaint& paint);
1312 virtual void onDrawRRect(
const SkRRect& rrect,
const SkPaint& paint);
1313 virtual void onDrawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
1315 virtual void onDrawVerticesObject(
const SkVertices* vertices, SkBlendMode mode,
1318 const SkColor colors[],
int count, SkBlendMode mode,
1320 virtual void onDrawPath(
const SkPath& path,
const SkPaint& paint);
1321 virtual void onDrawImage(
const SkImage* image, SkScalar dx, SkScalar dy,
const SkPaint* paint);
1323 const SkPaint* paint, SrcRectConstraint constraint);
1326 virtual void onDrawImageLattice(
const SkImage* image,
const Lattice& lattice,
const SkRect& dst,
1329 virtual void onDrawBitmap(
const SkBitmap& bitmap, SkScalar dx, SkScalar dy,
1332 const SkPaint* paint, SrcRectConstraint constraint);
1335 virtual void onDrawBitmapLattice(
const SkBitmap& bitmap,
const Lattice& lattice,
1337 virtual void onDrawShadowRec(
const SkPath&,
const SkDrawShadowRec&);
1339 enum ClipEdgeStyle {
1340 kHard_ClipEdgeStyle,
1344 virtual void onClipRect(
const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle);
1345 virtual void onClipRRect(
const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle);
1346 virtual void onClipPath(
const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle);
1347 virtual void onClipRegion(
const SkRegion& deviceRgn, SkClipOp op);
1349 virtual void onDiscard();
1358 bool clipRectBounds(
const SkRect* bounds, SaveLayerFlags flags,
SkIRect* intersection,
1375 bool done()
const {
return fDone; }
1381 SkBaseDevice* device()
const;
1394 intptr_t fStorage[32];
1395 class SkDrawIter* fImpl;
1400 static bool BoundsAffectsClip(SaveLayerFlags);
1401 static SaveLayerFlags LegacySaveFlagsToSaveLayerFlags(uint32_t legacySaveFlags);
1403 static void DrawDeviceWithFilter(SkBaseDevice* src,
const SkImageFilter* filter,
1404 SkBaseDevice* dst,
const SkIPoint& dstOrigin,
1415 void predrawNotify(
bool willOverwritesEntireSurface =
false);
1416 void predrawNotify(
const SkRect* rect,
const SkPaint* paint, ShaderOverrideOpacity);
1417 void predrawNotify(
const SkRect* rect,
const SkPaint* paint,
bool shaderOverrideIsOpaque) {
1418 this->predrawNotify(rect, paint, shaderOverrideIsOpaque ? kOpaque_ShaderOverrideOpacity
1419 : kNotOpaque_ShaderOverrideOpacity);
1422 SkBaseDevice* getDevice()
const;
1423 SkBaseDevice* getTopDevice()
const;
1434 kDeviceCMSize = 224,
1436 intptr_t fMCRecStorage[kMCRecSize * kMCRecCount /
sizeof(intptr_t)];
1437 intptr_t fDeviceCMStorage[kDeviceCMSize /
sizeof(intptr_t)];
1444 std::unique_ptr<SkRasterHandleAllocator> fAllocator;
1446 SkSurface_Base* fSurfaceBase;
1447 SkSurface_Base* getSurfaceBase()
const {
return fSurfaceBase; }
1448 void setSurfaceBase(SkSurface_Base* sb) {
1451 friend class SkSurface_Base;
1452 friend class SkSurface_Gpu;
1454 SkIRect fClipRestrictionRect = SkIRect::MakeEmpty();
1457 void checkForDeferredSave();
1458 void internalSetMatrix(
const SkMatrix&);
1460 friend class SkDrawIter;
1461 friend class AutoDrawLooper;
1462 friend class SkDebugCanvas;
1463 friend class SkSurface_Raster;
1464 friend class SkNoDrawCanvas;
1466 friend class SkPictureRecord;
1467 friend class SkPicturePlayback;
1468 friend class SkOverdrawCanvas;
1472 kDefault_InitFlags = 0,
1473 kConservativeRasterClip_InitFlag = 1 << 0,
1476 SkCanvas(SkBaseDevice* device, InitFlags);
1478 SkRasterHandleAllocator::Handle);
1480 void resetForNextPicture(
const SkIRect& bounds);
1483 friend class SkCanvasStateUtils;
1488 void setupDevice(SkBaseDevice*);
1490 SkBaseDevice* init(SkBaseDevice*, InitFlags);
1496 SkIRect getTopLayerBounds()
const;
1498 void internalDrawBitmapRect(
const SkBitmap& bitmap,
const SkRect* src,
1501 void internalDrawPaint(
const SkPaint& paint);
1502 void internalSaveLayer(
const SaveLayerRec&, SaveLayerStrategy);
1503 void internalDrawDevice(SkBaseDevice*,
int x,
int y,
const SkPaint*,
SkImage* clipImage,
1507 void internalSave();
1508 void internalRestore();
1515 bool wouldOverwriteEntireSurface(
const SkRect*,
const SkPaint*, ShaderOverrideOpacity)
const;
1520 bool canDrawBitmapAsSprite(SkScalar x, SkScalar y,
int w,
int h,
const SkPaint&);
1526 bool androidFramework_isClipAA()
const;
1533 SkRect fDeviceClipBounds;
1535 bool fAllowSoftClip;
1536 bool fAllowSimplifyClip;
1541 fCanvas->validateClip();
1550 void validateClip()
const;
1552 void validateClip()
const {}
1593 #define SkAutoCanvasRestore(...) SK_REQUIRE_LOCAL_VAR(SkAutoCanvasRestore)
bool getLocalClipBounds(SkRect *bounds) const
Returns true if the clip bounds are non-empty.
Definition: SkCanvas.h:528
void discard()
This makes the contents of the canvas undefined.
Definition: SkCanvas.h:574
A Canvas encapsulates all of the state about drawing into a device (bitmap).
Definition: SkCanvas.h:59
bool getDeviceClipBounds(SkIRect *bounds) const
Returns true if the clip bounds are non-empty.
Definition: SkCanvas.h:542
Definition: SkCanvas.h:326
Definition: SkPictureImageFilter.h:14
int getSaveCount() const
Returns the number of matrix/clip states on the SkCanvas' private stack.
The SkRRect class represents a rounded rect with a potentially different radii for each corner...
Definition: SkRRect.h:47
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:25
Describe an image's dimensions and pixel type.
Definition: SkImageInfo.h:181
SkTextBlob combines multiple text runs into an immutable, ref-counted structure.
Definition: SkTextBlob.h:24
If kFast is specified, the implementation may sample outside of the src-rect (if specified) by half t...
Definition: SkCanvas.h:768
After calling saveLayer(), there can be any number of devices that make up the top-most drawing area...
Definition: SkCanvas.h:1368
SkIRect getDeviceClipBounds() const
Return the bounds of the current clip in device coordinates.
Definition: SkCanvas.h:537
SkRect getLocalClipBounds() const
Return the bounds of the current clip in local coordinates.
Definition: SkCanvas.h:523
bool fIsScaleTranslate
Keep track of the device clip bounds and if the matrix is scale-translate.
Definition: SkCanvas.h:1532
PointMode
Definition: SkCanvas.h:583
Describes properties and constraints of a given SkSurface.
Definition: SkSurfaceProps.h:51
Pairs SkImageInfo with actual pixels and rowbytes.
Definition: SkPixmap.h:23
Definition: SkPoint.h:156
void setAllowSimplifyClip(bool allow)
EXPERIMENTAL – only used for testing Set to simplify clip stack using path ops.
Definition: SkCanvas.h:484
there is no overriding shader (bitmap or image)
Definition: SkCanvas.h:1408
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:28
SkSurface is responsible for managing the pixels that a canvas draws into.
Definition: SkSurface.h:32
Definition: SkRefCnt.h:125
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
Definition: SkLights.h:20
void drawPicture(const SkPicture *picture)
Draw the picture into this canvas.
Definition: SkCanvas.h:1058
ShaderOverrideOpacity
Definition: SkCanvas.h:1407
An SkPicture records drawing commands made to a canvas to be played back at a later time...
Definition: SkPicture.h:38
Definition: SkCanvas.h:1538
SkData holds an immutable data buffer.
Definition: SkData.h:22
static SkImageInfo MakeN32Premul(int width, int height, sk_sp< SkColorSpace > cs=nullptr)
Sets colortype to the native ARGB32 type, and the alphatype to premul.
Definition: SkImageInfo.h:212
bool done() const
Return true if the iterator is done.
Definition: SkCanvas.h:1375
the overriding shader may not be opaque
Definition: SkCanvas.h:1410
Specifies coordinates to divide a bitmap into (xCount*yCount) rects.
Definition: SkCanvas.h:892
void clear(SkColor color)
Helper method for drawing a color in SRC mode, completely replacing all the pixels in the current cli...
Definition: SkCanvas.h:558
The SkBitmap class specifies a raster bitmap.
Definition: SkBitmap.h:37
Base class for image filters.
Definition: SkImageFilter.h:36
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:246
bool isEmpty() const
Return true if the rectangle's width or height are <= 0.
Definition: SkRect.h:103
drawPoints draws each pair of points as a line segment
Definition: SkCanvas.h:587
DEPRECATED - use SkPaintFilterCanvas instead.
Definition: SkDrawFilter.h:26
Definition: GrContext.h:47
SrcRectConstraint
Controls the behavior at the edge of the src-rect, when specified in drawImageRect, trading off speed for exactness.
Definition: SkCanvas.h:755
The SkRegion class encapsulates the geometric region used to specify clipping areas for drawing...
Definition: SkRegion.h:30
An immutable set of vertex data that can be used with SkCanvas::drawVertices.
Definition: SkVertices.h:20
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:161
the overriding shader is opaque
Definition: SkCanvas.h:1409
Base-class for objects that draw into SkCanvas.
Definition: SkDrawable.h:26
void drawIRect(const SkIRect &rect, const SkPaint &paint)
Draw the specified rectangle using the specified paint.
Definition: SkCanvas.h:648
uint32_t SkColor
32 bit ARGB color value, not premultiplied.
Definition: SkColor.h:28
drawPoints draws each point separately
Definition: SkCanvas.h:585
If kStrict is specified, the implementation must respect the src-rect (if specified) strictly...
Definition: SkCanvas.h:761
void restoreToCount(int saveCount)
Efficient way to pop any calls to save() that happened after the save count reached saveCount...
Stack helper class to automatically call restoreToCount() on the canvas when this object goes out of ...
Definition: SkCanvas.h:1562
void restore()
Perform the restore now, instead of waiting for the destructor.
Definition: SkCanvas.h:1582
int save()
This call saves the current matrix, clip, and drawFilter, and pushes a copy onto a private stack...
If a client wants to control the allocation of raster layers in a canvas, it should subclass SkRaster...
Definition: SkRasterHandleAllocator.h:36
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
unsigned U8CPU
Fast type for unsigned 8 bits.
Definition: SkTypes.h:191
bool isEmpty() const
Return true if the rectangle's width or height are <= 0.
Definition: SkRect.h:472
SkImage is an abstraction for drawing a rectagle of pixels, though the particular type of image could...
Definition: SkImage.h:48
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40
Light weight class for managing strings.
Definition: SkString.h:121
void drawString(const char *string, SkScalar x, SkScalar y, const SkPaint &paint)
Draw null-terminated UTF-8 string, with origin at (x,y), using the specified paint.
Definition: SkCanvas.h:967