26 return info.colorType() == kN32_SkColorType;
35 , fColorInfo(colorInfo)
103 bool strict)
const override {
148 return sk_make_sp<SkSpecialImage_Raster>(subset, *srcBM, props);
164 info =
info.makeColorType(kN32_SkColorType);
176 return sk_make_sp<SkSpecialImage_Raster>(
192 if (
as_IB(
image)->getROPixels(
nullptr, &bm)) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static SkImage_Base * as_IB(SkImage *image)
static bool valid_for_imagefilters(const SkImageInfo &info)
@ kNeedNewImageUniqueID_SpecialImage
sk_sp< SkImage > asImage() const
SkPixelRef * pixelRef() const
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
SkISize dimensions() const
size_t computeByteSize() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
const SkImageInfo & info() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
bool tryAllocPixels(const SkImageInfo &info, size_t rowBytes)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
static sk_sp< SkShader > MakeSubset(sk_sp< SkImage >, const SkRect &subset, SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix, bool clampAsIfUnpremul=false)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
virtual bool isTextureBacked() const =0
SkMatrix & postConcat(const SkMatrix &other)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
sk_sp< SkShader > asShader(SkTileMode tileMode, const SkSamplingOptions &sampling, const SkMatrix &lm, bool strict) const override
sk_sp< SkSpecialImage > onMakeBackingStoreSubset(const SkIRect &subset) const override
size_t getSize() const override
sk_sp< SkImage > asImage() const override
SkISize backingStoreDimensions() const override
bool getROPixels(SkBitmap *bm) const
SkSpecialImage_Raster(const SkIRect &subset, const SkBitmap &bm, const SkSurfaceProps &props)
void draw(SkCanvas *canvas, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint, bool strict=true) const
virtual sk_sp< SkImage > asImage() const =0
virtual bool isGaneshBacked() const
SkSpecialImage(const SkIRect &subset, uint32_t uniqueID, const SkColorInfo &, const SkSurfaceProps &)
const SkIRect & subset() const
const SkSurfaceProps & props() const
const SkColorInfo & colorInfo() const
virtual sk_sp< SkShader > asShader(SkTileMode, const SkSamplingOptions &, const SkMatrix &lm, bool strict=true) const
virtual bool isGraphiteBacked() const
sk_sp< const SkImage > image
SkSamplingOptions sampling
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)
constexpr int32_t x() const
constexpr int32_t y() const
constexpr SkISize size() const
constexpr int32_t height() const
constexpr int32_t width() const
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
bool contains(int32_t x, int32_t y) const
SkImageInfo makeDimensions(SkISize newSize) const
SkImageInfo makeColorType(SkColorType newColorType) const
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)