diff options
author | 2016-03-04 11:07:43 -0800 | |
---|---|---|
committer | 2016-03-04 11:07:43 -0800 | |
commit | d8829015768a1cf989ffb13e6e632c8f21d339db (patch) | |
tree | 8e3672da830f2a9f1a6bd19b8e279382ba493058 /src/core/SkBitmapProcShader.h | |
parent | 7520fc4ad3a12476a27f098e7c00847ae0e5bcf4 (diff) |
Add support for new bitmapshader context (patchset #5 id:80001 of https://codereview.chromium.org/1757993002/ )"
This reverts commit cd660e1c07371d9cf97824245639b1c0b5ac92fc.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1760123003
Review URL: https://codereview.chromium.org/1760123003
Diffstat (limited to 'src/core/SkBitmapProcShader.h')
-rw-r--r-- | src/core/SkBitmapProcShader.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h index ebd9f3f8fb..dc4d832ca3 100644 --- a/src/core/SkBitmapProcShader.h +++ b/src/core/SkBitmapProcShader.h @@ -21,8 +21,6 @@ public: bool isOpaque() const override; - size_t onContextSize(const ContextRec& rec) const override { return ContextSize(rec); } - SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) @@ -33,16 +31,19 @@ public: protected: void flatten(SkWriteBuffer&) const override; + size_t onContextSize(const ContextRec& rec) const override { + return ContextSize(rec, fRawBitmap.info()); + } 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 +55,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. |