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

Unified Diff: src/core/SkLocalMatrixShader.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 | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkPictureShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLocalMatrixShader.h
diff --git a/src/core/SkLocalMatrixShader.h b/src/core/SkLocalMatrixShader.h
index 1adfb0a730e62693e1cbb045c0080ed6f23558a9..1143f062d386689cf2a10ded238ad87f446420ce 100644
--- a/src/core/SkLocalMatrixShader.h
+++ b/src/core/SkLocalMatrixShader.h
@@ -32,15 +32,27 @@ public:
return fProxyShader->asAGradient(info);
}
- virtual GrEffectRef* asNewEffect(GrContext* ctx, const SkPaint& paint,
- const SkMatrix* localMatrix) const SK_OVERRIDE {
+#if SK_SUPPORT_GPU
+
+ virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix,
+ GrColor* grColor, GrEffectRef** grEffect) const SK_OVERRIDE {
SkMatrix tmp = fProxyLocalMatrix;
if (localMatrix) {
tmp.preConcat(*localMatrix);
}
- return fProxyShader->asNewEffect(ctx, paint, &tmp);
+ return fProxyShader->asNewEffect(context, paint, &tmp, grColor, grEffect);
}
-
+
+#else
+
+ virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix,
+ GrColor* grColor, GrEffectRef** grEffect) const SK_OVERRIDE {
+ SkDEBUGFAIL("Should not call in GPU-less build");
+ return false;
+ }
+
+#endif
+
virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OVERRIDE {
if (localMatrix) {
*localMatrix = fProxyLocalMatrix;
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkPictureShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698