class GrDirectContext; class SkColorSpace; class SkData; class SkPixmap; class SkSurface; class SkImageShader; enum SkColorType : int; struct SkIRect; struct SkImageInfo;
enumclass SkCopyPixelsMode {
kIfMutable, //!< only copy src pixels if they are marked mutable
kAlways, //!< always copy src pixels (even if they are marked immutable)
kNever, //!< never copy src pixels (even if they are marked mutable)
};
class SkImage_Raster : public SkImage_Base { public:
SkImage_Raster(const SkImageInfo&, sk_sp<SkData>, size_t rb, sk_sp<SkMipmap>, uint32_t id);
~SkImage_Raster() override;
// From SkImage.h bool isValid(SkRecorder* recorder) const override { if (!recorder) { returnfalse;
} if (!recorder->cpuRecorder()) { returnfalse;
} returntrue;
}
sk_sp<SkImage> makeColorTypeAndColorSpace(SkRecorder*,
SkColorType targetColorType,
sk_sp<SkColorSpace> targetColorSpace,
RequiredProperties) const override;
// From SkImage_Base.h bool onReadPixels(GrDirectContext*, const SkImageInfo&, void*, size_t, int srcX, int srcY,
CachingHint) const override; bool onPeekPixels(SkPixmap*) const override; const SkBitmap* onPeekBitmap() const override { return &fBitmap; }
void notifyAddedToRasterCache() const override { // We explicitly DON'T want to call INHERITED::notifyAddedToRasterCache. That ties the // lifetime of derived/cached resources to the image. In this case, we only want cached // data (eg mips) tied to the lifetime of the underlying pixelRef.
SkASSERT(fBitmap.pixelRef());
fBitmap.pixelRef()->notifyAddedToCache();
}
// Convenience method to return a shader that implements the shader+image behavior defined for // drawImage/Bitmap where the paint's shader is ignored when the bitmap is a color image, but // properly compose them together when it is an alpha image. This allows the returned paint to // be assigned to a paint clone without discarding the original behavior.
sk_sp<SkShader> makeShaderForPaint(const SkPaint& paint,
SkTileMode tmx,
SkTileMode tmy, const SkSamplingOptions& sampling, const SkMatrix* localMatrix);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.