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

Unified Diff: src/core/SkPictureShader.h

Issue 241283003: Revert of Extract most of the mutable state of SkShader into a separate Context object. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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 | « src/core/SkFilterShader.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureShader.h
diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h
index a0a377d0cdada654f7f0f863533d780f781365d7..ea74b56d73d857394f9c20b227d41368f1623fa0 100644
--- a/src/core/SkPictureShader.h
+++ b/src/core/SkPictureShader.h
@@ -24,33 +24,13 @@
static SkPictureShader* Create(SkPicture*, TileMode, TileMode);
virtual ~SkPictureShader();
- virtual bool validContext(const SkBitmap&, const SkPaint&,
- const SkMatrix&, SkMatrix* totalInverse = NULL) const SK_OVERRIDE;
- virtual SkShader::Context* createContext(const SkBitmap& device, const SkPaint& paint,
- const SkMatrix& matrix, void* storage) const
- SK_OVERRIDE;
- virtual size_t contextSize() const SK_OVERRIDE;
+ virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK_OVERRIDE;
+ virtual void endContext() SK_OVERRIDE;
+ virtual uint32_t getFlags() SK_OVERRIDE;
- class PictureShaderContext : public SkShader::Context {
- public:
- PictureShaderContext(const SkPictureShader& shader, const SkBitmap& device,
- const SkPaint& paint, const SkMatrix& matrix,
- SkShader* bitmapShader);
- virtual ~PictureShaderContext();
-
- virtual uint32_t getFlags() const SK_OVERRIDE;
-
- virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
- virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE;
- virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
-
- private:
- SkAutoTUnref<SkShader> fBitmapShader;
- SkShader::Context* fBitmapShaderContext;
- void* fBitmapShaderContextStorage;
-
- typedef SkShader::Context INHERITED;
- };
+ virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
+ virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE;
+ virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureShader)
@@ -66,18 +46,13 @@
private:
SkPictureShader(SkPicture*, TileMode, TileMode);
- SkShader* validInternal(const SkBitmap& device, const SkPaint& paint,
- const SkMatrix& matrix, SkMatrix* totalInverse) const;
-
- SkShader* buildBitmapShader(const SkMatrix&) const;
+ bool buildBitmapShader(const SkMatrix&) const;
SkPicture* fPicture;
TileMode fTmx, fTmy;
- mutable SkMutex fCachedBitmapShaderMutex;
- mutable SkAutoTUnref<SkShader> fCachedBitmapShader;
+ mutable SkAutoTUnref<SkShader> fCachedShader;
mutable SkSize fCachedTileScale;
- mutable SkMatrix fCachedLocalMatrix;
typedef SkShader INHERITED;
};
« no previous file with comments | « src/core/SkFilterShader.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698