Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/core/SkBitmapProcShader.h

Issue 1760123003: Add support for new bitmapshader context (patchset #5 id:80001 of https://codereview.chromium.org/1… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/SkLinearBitmapPipelineGM.cpp ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.h
diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h
index ebd9f3f8fbfb7068c6ae5f43ec8c4a5beec3d7d1..dc4d832ca3dad0be49f9a7d84ed279010f7b5a64 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.
« no previous file with comments | « gm/SkLinearBitmapPipelineGM.cpp ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698