| Index: src/core/SkImagePriv.h
|
| diff --git a/src/core/SkImagePriv.h b/src/core/SkImagePriv.h
|
| index ed40996acd0a1e31e5e3a547961011382df738d9..3077f343677d034994846cdb897812258bc0364c 100644
|
| --- a/src/core/SkImagePriv.h
|
| +++ b/src/core/SkImagePriv.h
|
| @@ -9,19 +9,35 @@
|
| #define SkImagePriv_DEFINED
|
|
|
| #include "SkImage.h"
|
| +#include "SkSmallAllocator.h"
|
| #include "SkSurface.h"
|
|
|
| -// Call this if you explicitly want to use/share this pixelRef in the image
|
| -extern sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo&, SkPixelRef*,
|
| - const SkIPoint& pixelRefOrigin,
|
| - size_t rowBytes);
|
| -
|
| enum SkCopyPixelsMode {
|
| kIfMutable_SkCopyPixelsMode, //!< only copy src pixels if they are marked mutable
|
| kAlways_SkCopyPixelsMode, //!< always copy src pixels (even if they are marked immutable)
|
| kNever_SkCopyPixelsMode, //!< never copy src pixels (even if they are marked mutable)
|
| };
|
|
|
| +enum {kSkBlitterContextSize = 3332};
|
| +
|
| +// Commonly used allocator. It currently is only used to allocate up to 3 objects. The total
|
| +// bytes requested is calculated using one of our large shaders, its context size plus the size of
|
| +// an Sk3DBlitter in SkDraw.cpp
|
| +// Note that some contexts may contain other contexts (e.g. for compose shaders), but we've not
|
| +// yet found a situation where the size below isn't big enough.
|
| +typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator;
|
| +
|
| +// If alloc is non-nullptr, it will be used to allocate the returned SkShader, and MUST outlive
|
| +// the SkShader.
|
| +sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
|
| + const SkMatrix* localMatrix, SkCopyPixelsMode,
|
| + SkTBlitterAllocator* alloc);
|
| +
|
| +// Call this if you explicitly want to use/share this pixelRef in the image
|
| +extern sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo&, SkPixelRef*,
|
| + const SkIPoint& pixelRefOrigin,
|
| + size_t rowBytes);
|
| +
|
| /**
|
| * Examines the bitmap to decide if it can share the existing pixelRef, or
|
| * if it needs to make a deep-copy of the pixels.
|
| @@ -40,7 +56,8 @@ enum SkCopyPixelsMode {
|
| * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
|
| * nullptr.
|
| */
|
| -extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, SkCopyPixelsMode);
|
| +extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, SkCopyPixelsMode,
|
| + SkTBlitterAllocator* = nullptr);
|
|
|
| // Given an image created from SkNewImageFromBitmap, return its pixelref. This
|
| // may be called to see if the surface and the image share the same pixelref,
|
|
|