aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcShader.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-03 09:16:22 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-03 09:16:22 -0800
commit19cef56344b5a5f26f802d7be34c44af36b7e797 (patch)
tree4d8510a489ace60f36b9348585cc10cb5fde99a4 /src/core/SkBitmapProcShader.h
parent1610835624a9658cc60940b80038b84f297e836f (diff)
add support for new bitmapshader context
Diffstat (limited to 'src/core/SkBitmapProcShader.h')
-rw-r--r--src/core/SkBitmapProcShader.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h
index 9f4c16202c..a83fda7628 100644
--- a/src/core/SkBitmapProcShader.h
+++ b/src/core/SkBitmapProcShader.h
@@ -21,7 +21,9 @@ public:
bool isOpaque() const override;
- size_t contextSize(const ContextRec& rec) const override { return ContextSize(rec); }
+ size_t contextSize(const ContextRec& rec) const override {
+ return ContextSize(rec, fRawBitmap.info());
+ }
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader)
@@ -36,13 +38,13 @@ protected:
Context* onCreateContext(const ContextRec&, void* storage) const override;
bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode*) const override;
- SkBitmap fRawBitmap; // experimental for RLE encoding
+ SkBitmap fRawBitmap;
uint8_t fTileModeX, fTileModeY;
private:
friend class SkImageShader;
- static size_t ContextSize(const ContextRec&);
+ static size_t ContextSize(const ContextRec&, const SkImageInfo& srcInfo);
static Context* MakeContext(const SkShader&, TileMode tmx, TileMode tmy,
const SkBitmapProvider&, const ContextRec&, void* storage);
@@ -54,7 +56,7 @@ private:
// 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, 1500> SkTBlitterAllocator;
+typedef SkSmallAllocator<3, 2100> SkTBlitterAllocator;
// If alloc is non-nullptr, it will be used to allocate the returned SkShader, and MUST outlive
// the SkShader.