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

Unified Diff: include/gpu/GrEffect.h

Issue 571163002: removing GrDrawEffect (Closed) Base URL: https://skia.googlesource.com/skia.git@gp3
Patch Set: rebase after revert Created 6 years, 3 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/gpu/GrDrawEffect.h ('k') | include/gpu/GrTBackendEffectFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffect.h
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 102b9d4b961ba89743c8b002426182633ad7b83f..e9259979f0af3946deddf5523ed93d2fd194ecce 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -130,6 +130,11 @@ public:
::operator delete(target, placement);
}
+ /**
+ * Helper for down-casting to a GrEffect subclass
+ */
+ template <typename T> const T& cast() const { return *static_cast<const T*>(this); }
+
protected:
/**
* Subclasses call this from their constructor to register coordinate transformations. The
@@ -155,13 +160,6 @@ protected:
, fRequiresVertexShader(false) {}
/**
- * Helper for down-casting to a GrEffect subclass
- */
- template <typename T> static const T& CastEffect(const GrEffect& effect) {
- return *static_cast<const T*>(&effect);
- }
-
- /**
* If the effect subclass will read the destination pixel value then it must call this function
* from its constructor. Otherwise, when its generated backend-specific effect class attempts
* to generate code that reads the destination pixel it will fail.
« no previous file with comments | « include/gpu/GrDrawEffect.h ('k') | include/gpu/GrTBackendEffectFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698