Chromium Code Reviews| Index: include/gpu/GrEffect.h |
| diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h |
| index 102b9d4b961ba89743c8b002426182633ad7b83f..e622ba28ce7ae3f43744fdca7dc8d43fe6dd5c3d 100644 |
| --- a/include/gpu/GrEffect.h |
| +++ b/include/gpu/GrEffect.h |
| @@ -130,6 +130,13 @@ public: |
| ::operator delete(target, placement); |
| } |
| + /** |
| + * Helper for down-casting to a GrEffect subclass |
| + */ |
| + template <typename T> static const T& CastEffect(const GrEffect& effect) { |
|
bsalomon
2014/09/15 19:54:25
How about
template <typename T> const T& cast() c
|
| + return *static_cast<const T*>(&effect); |
| + } |
| + |
| protected: |
| /** |
| * Subclasses call this from their constructor to register coordinate transformations. The |
| @@ -155,13 +162,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. |