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

Unified Diff: include/core/SkShader.h

Issue 318923005: SkShader::asNewEffect Refactoring (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added macros to check for gpu support Created 6 years, 6 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/SkColorShader.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 82efab27410439b369d2186012354f480232fc0b..31f57cc3a6a719034e652b75d6105b051ded0192 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -14,6 +14,7 @@
#include "SkMask.h"
#include "SkMatrix.h"
#include "SkPaint.h"
+#include "../gpu/GrColor.h"
class SkPath;
class SkPicture;
@@ -373,14 +374,17 @@ public:
/**
- * If the shader subclass has a GrEffect implementation, this resturns the effect to install.
+ * Returns true if the shader subclass succeeds in setting the grEffect and the grColor output
+ * parameters to a value, returns false if it fails or if there is not an implementation of
+ * this method in the shader subclass.
* The incoming color to the effect has r=g=b=a all extracted from the SkPaint's alpha.
* The output color should be the computed SkShader premul color modulated by the incoming
* color. The GrContext may be used by the effect to create textures. The GPU device does not
* call createContext. Instead we pass the SkPaint here in case the shader needs paint info.
*/
- virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrixOrNull) const;
+ virtual bool asNewEffect(GrContext* context, const SkPaint& paint,
+ const SkMatrix* localMatrixOrNull, GrColor* grColor,
+ GrEffectRef** grEffect) const;
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
/**
@@ -463,7 +467,7 @@ protected:
private:
SkMatrix fLocalMatrix;
-
+
typedef SkFlattenable INHERITED;
};
« no previous file with comments | « include/core/SkColorShader.h ('k') | include/effects/SkPerlinNoiseShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698