78 bool fDone, fNeedsTiling;
82 return dev->
width() > kMaxDim || dev->
height() > kMaxDim;
96 fNeedsTiling = clipR.
right() > kMaxDim || clipR.
bottom() > kMaxDim;
114 fNeedsTiling = fSrcBounds.
right() > kMaxDim || fSrcBounds.
bottom() > kMaxDim;
116 fNeedsTiling =
false;
126 fDraw.
fRC = &fTileRC;
128 fOrigin.
set(fSrcBounds.
fLeft - kMaxDim, fSrcBounds.
fTop);
131 fDraw.
fDst = fRootPixmap;
133 fDraw.
fRC = &dev->fRCStack.
rc();
148 this->stepAndSetupTileDraw();
149 }
while (!fDone && fTileRC.
isEmpty());
163 void stepAndSetupTileDraw() {
168 if (fOrigin.
fX >= fSrcBounds.
fRight - kMaxDim) {
170 fOrigin.
fY += kMaxDim;
172 fOrigin.
fX += kMaxDim;
175 fDone = fOrigin.
fX >= fSrcBounds.
fRight - kMaxDim &&
176 fOrigin.
fY >= fSrcBounds.
fBottom - kMaxDim;
186 fDraw.
fCTM = fTileMatrix.
get();
187 fDevice->fRCStack.
rc().
translate(-fOrigin.
x(), -fOrigin.
y(), &fTileRC);
196#define LOOP_TILER(code, boundsPtr) \
197 SkDrawTiler priv_tiler(this, boundsPtr); \
198 while (const SkDraw* priv_draw = priv_tiler.next()) { \
212 fRC = &dev->fRCStack.
rc();
242 , fRasterHandle(hndl)
264 }
else if (allocator) {
269 }
else if (
info.isOpaque()) {
286void SkBitmapDevice::replaceBitmapBackendForRasterSurface(
const SkBitmap& bm) {
302 info =
info.makeColorType(kN32_SkColorType);
308bool SkBitmapDevice::onAccessPixels(
SkPixmap* pmap) {
309 if (this->onPeekPixels(pmap)) {
316bool SkBitmapDevice::onPeekPixels(
SkPixmap* pmap) {
325bool SkBitmapDevice::onWritePixels(
const SkPixmap& pm,
int x,
int y) {
338bool SkBitmapDevice::onReadPixels(
const SkPixmap& pm,
int x,
int y) {
364#ifdef SK_IGNORE_BLURRED_RRECT_OPT
375 bool pathIsMutable) {
382 pathIsMutable =
false;
398 storage = *
b.bounds();
406 if (!
paint.getMaskFilter()) {
427 SkRect bitmapBounds, tmpSrc, tmpDst;
436 tmpSrc = bitmapBounds;
445 bool srcIsSubset =
false;
452 matrix.mapRect(&tmpDst, tmpSrc);
458 srcIsSubset = !tmpSrc.
contains(bitmapBounds);
474 if (!
bitmap.extractSubset(&tmpBitmap, srcIR)) {
477 bitmapPtr = &tmpBitmap;
481 if (srcIR.
fLeft > 0) {
484 if (srcIR.
fTop > 0) {
491#ifdef SK_DRAWBITMAPRECT_FAST_OFFSET
496 SkRect extractedBitmapBounds;
499 if (extractedBitmapBounds == tmpSrc) {
529 this->
drawRect(*dstPtr, paintWithShader);
532void SkBitmapDevice::onDrawGlyphRunList(
SkCanvas* canvas,
542 bool skipColorXform) {
543#ifdef SK_LEGACY_IGNORE_DRAW_VERTICES_BLEND_WITH_NO_SHADER
544 if (!
paint.getShader()) {
588 draw.fRC = &fRCStack.
rc();
599 this->surfaceProps());
646 if (origin.
fX | origin.
fY) {
663 return rc.isBW() &&
rc.bwRgn().isRect() &&
673 return !
rc.isEmpty() &&
rc.isRect() && !
SkToBool(
rc.clipShader());
678 return !
rc.isEmpty() &&
rc.isAA();
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kOpaque_SkAlphaType
pixel is opaque
#define SkASSERT_RELEASE(cond)
static bool valid_for_bitmap_device(const SkImageInfo &info, SkAlphaType *newAlphaType)
static bool CanApplyDstMatrixAsCTM(const SkMatrix &m, const SkPaint &paint)
#define LOOP_TILER(code, boundsPtr)
@ kUnknown_SkColorType
uninitialized
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SK_API bool SkColorTypeIsAlwaysOpaque(SkColorType ct)
@ kNever_SkCopyPixelsMode
never copy src pixels (even if they are marked mutable)
sk_sp< SkShader > SkMakeBitmapShaderForPaint(const SkPaint &paint, const SkBitmap &src, SkTileMode, SkTileMode, const SkSamplingOptions &, const SkMatrix *localMatrix, SkCopyPixelsMode)
static SkImage_Base * as_IB(SkImage *image)
static constexpr bool SkToBool(const T &x)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
BDDraw(SkBitmapDevice *dev)
bool isClipEmpty() const override
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override
void drawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
void drawPath(const SkPath &, const SkPaint &, bool pathIsMutable) override
void drawImageRect(const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
bool isClipAntiAliased() const override
void popClipStack() override
sk_sp< SkSurface > makeSurface(const SkImageInfo &, const SkSurfaceProps &) override
void android_utils_clipAsRgn(SkRegion *) const override
sk_sp< SkSpecialImage > makeSpecial(const SkBitmap &) override
SkIRect devClipBounds() const override
void clipPath(const SkPath &path, SkClipOp, bool aa) override
void clipRegion(const SkRegion &deviceRgn, SkClipOp) override
sk_sp< SkDevice > createDevice(const CreateInfo &, const SkPaint *) override
static sk_sp< SkBitmapDevice > Create(const SkImageInfo &, const SkSurfaceProps &, SkRasterHandleAllocator *=nullptr)
void drawRRect(const SkRRect &rr, const SkPaint &paint) override
SkBitmapDevice(const SkBitmap &bitmap)
bool isClipRect() const override
void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint) override
void drawPaint(const SkPaint &paint) override
void drawOval(const SkRect &oval, const SkPaint &paint) override
void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &) override
void drawSpecial(SkSpecialImage *, const SkMatrix &, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
void clipRect(const SkRect &rect, SkClipOp, bool aa) override
bool isClipWideOpen() const override
void drawRect(const SkRect &r, const SkPaint &paint) override
void replaceClip(const SkIRect &rect) override
void pushClipStack() override
void clipRRect(const SkRRect &rrect, SkClipOp, bool aa) override
void notifyPixelsChanged() const
bool writePixels(const SkPixmap &src, int dstX, int dstY)
const SkImageInfo & info() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
@ kZeroPixels_AllocFlag
zero pixel memory. No effect. This is the default.
static sk_sp< SkBlender > Mode(SkBlendMode mode)
@ kFast_SrcRectConstraint
sample outside bounds; faster
const SkImageInfo & imageInfo() const
SkIPoint getOrigin() const
virtual void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &)
void drawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
const SkM44 & globalToDevice() const
sk_sp< SkSpecialImage > snapSpecial()
bool accessPixels(SkPixmap *pmap)
const SkMatrix & localToDevice() const
const SkSurfaceProps & surfaceProps() const
void drawPaint(const SkPaint &) const
const SkSurfaceProps * fProps
SkDrawTiler(SkBitmapDevice *dev, const SkRect *bounds)
static bool NeedsTiling(SkBitmapDevice *dev)
void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &)
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform) const
virtual GrDirectContext * directContext() const
sk_sp< SkImage > makeNonTextureImage(GrDirectContext *=nullptr) const
static SkRect MapRect(const SkM44 &m, const SkRect &r)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
static const SkMatrix & I()
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
@ kTranslate_Mask
translation SkMatrix
void setStyle(Style style)
@ kFill_Style
set to fill geometry
void setShader(sk_sp< SkShader > shader)
SkImageFilter * getImageFilter() const
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
SkISize dimensions() const
bool extractSubset(SkPixmap *subset, const SkIRect &area) const
const SkRect & getBounds() const
void clipShader(sk_sp< SkShader > sh)
void clipPath(const SkMatrix &ctm, const SkPath &path, SkClipOp op, bool aa)
void replaceClip(const SkIRect &rect)
void clipRegion(const SkRegion &rgn, SkClipOp op)
const SkRasterClip & rc() const
void clipRect(const SkMatrix &ctm, const SkRect &rect, SkClipOp op, bool aa)
void clipRRect(const SkMatrix &ctm, const SkRRect &rrect, SkClipOp op, bool aa)
const SkIRect & getBounds() const
void translate(int dx, int dy, SkRasterClip *dst) const
bool op(const SkIRect &, SkClipOp)
void translate(int dx, int dy)
bool setRect(const SkIRect &rect)
SkSurfaceProps cloneWithPixelGeometry(SkPixelGeometry newPixelGeometry) const
T * init(Args &&... args)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
bool AsBitmap(const SkSpecialImage *img, SkBitmap *result)
sk_sp< SkSpecialImage > MakeFromRaster(const SkIRect &subset, const SkBitmap &bm, const SkSurfaceProps &props)
sk_sp< SkSpecialImage > CopyFromRaster(const SkIRect &subset, const SkBitmap &bm, const SkSurfaceProps &props)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
SkSamplingOptions(SkFilterMode::kLinear))
const SkRect * bounds() const
Bounder(const SkRect &r, const SkPaint &paint)
const SkPixelGeometry fPixelGeometry
SkRasterHandleAllocator * fAllocator
constexpr int32_t y() const
void set(int32_t x, int32_t y)
constexpr int32_t x() const
bool intersect(const SkIRect &r)
int32_t fBottom
larger y-axis bounds
constexpr int32_t bottom() const
constexpr int32_t right() const
int32_t fTop
smaller y-axis bounds
static constexpr SkIRect MakeSize(const SkISize &size)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
SkAlphaType alphaType() const
static SkRect Make(const SkISize &size)
bool intersect(const SkRect &r)
static SkRect MakeIWH(int w, int h)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
bool contains(SkScalar x, SkScalar y) const
void roundOut(SkIRect *dst) const
void round(SkIRect *dst) const
void setIWH(int32_t width, int32_t height)