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

Unified Diff: include/core/SkShader.h

Issue 262703002: add default impl for context methods on shader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update dox, keep contextSize() defaulting to 0 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 | « no previous file | src/core/SkShader.cpp » ('j') | src/core/SkShader.cpp » ('J')
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 4af8f78bfbaa9ca8523b3262870081fbd10ace65..b0a7fd9f8a1474c2872bf9851ca163551f7933d1 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -207,16 +207,22 @@ public:
* 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 SkBitmap& device,
const SkPaint& paint,
const SkMatrix& matrix,
- void* storage) const = 0;
+ void* storage) const;
/**
* Return the size of a Context returned by createContext.
+ *
+ * Override this if your subclass overrides createContext, to return the correct size of
+ * your subclass' context.
*/
- virtual size_t contextSize() const = 0;
+ virtual size_t contextSize() const;
/**
* Helper to check the flags to know if it is legal to call shadeSpan16()
« no previous file with comments | « no previous file | src/core/SkShader.cpp » ('j') | src/core/SkShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698