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

Unified Diff: include/core/SkShader.h

Issue 261773005: Remove SkShader virtual method validContext (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: correctly call shaderA/B in composeshader Created 6 years, 7 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 | « include/core/SkEmptyShader.h ('k') | include/effects/SkPerlinNoiseShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkShader.h
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index bcb229d767143caaa0f68370300ddd610966e800..041730633a606fecdb60ed00636d2dbd3d1502fd 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -213,20 +213,10 @@ public:
};
/**
- * Subclasses should be sure to call their INHERITED::validContext() if
- * they override this method.
- */
- virtual bool validContext(const ContextRec&, SkMatrix* totalInverse = NULL) const;
-
- /**
* Create the actual object that does the shading.
- * Returns NULL if validContext() returns false.
* Size of storage must be >= contextSize.
- * Your subclass must also override contextSize() if it overrides createContext().
- *
- * Base class implementation returns NULL.
*/
- virtual Context* createContext(const ContextRec&, void* storage) const;
+ Context* createContext(const ContextRec&, void* storage) const;
/**
* Return the size of a Context returned by createContext.
@@ -374,6 +364,11 @@ public:
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders
+ /**
+ * Call this to create a new "empty" shader, that will not draw anything.
+ */
+ static SkShader* CreateEmptyShader();
+
/** Call this to create a new shader that will draw with the specified bitmap.
*
* If the bitmap cannot be used (e.g. has no pixels, or its dimensions
@@ -409,14 +404,19 @@ public:
SK_DEFINE_FLATTENABLE_TYPE(SkShader)
protected:
-
SkShader(SkReadBuffer& );
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
-private:
- SkMatrix fLocalMatrix;
+ bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const;
+
+ /**
+ * Your subclass must also override contextSize() if it overrides onCreateContext().
+ * Base class impl returns NULL.
+ */
+ virtual Context* onCreateContext(const ContextRec&, void* storage) const;
- bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) const;
+private:
+ SkMatrix fLocalMatrix;
typedef SkFlattenable INHERITED;
};
« no previous file with comments | « include/core/SkEmptyShader.h ('k') | include/effects/SkPerlinNoiseShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698