aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-16 15:16:18 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-16 15:16:18 +0000
commit0ac6af49975c54c2debf41e9200af416ecd2d973 (patch)
tree79ee2038a2b5c994f688f30f9770310555dcc6bf /include/core
parent6f54724c11ab739fa0d6deff1d4b564596fe3970 (diff)
Wrap GrEffects in GrEffectPtr.
This is the first step towards automatic recycling of scratch resouces in the cache via ref-cnts. R=robertphillips@google.com Review URL: https://codereview.appspot.com/7092061 git-svn-id: http://skia.googlecode.com/svn/trunk@7222 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkColorFilter.h4
-rw-r--r--include/core/SkImageFilter.h4
-rw-r--r--include/core/SkPostConfig.h14
-rw-r--r--include/core/SkShader.h5
4 files changed, 13 insertions, 14 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 4f67c8dbfe..65a8cf33c2 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -15,7 +15,7 @@
#include "SkXfermode.h"
class SkBitmap;
-class GrEffect;
+class GrEffectRef;
class GrContext;
class SK_API SkColorFilter : public SkFlattenable {
@@ -118,7 +118,7 @@ public:
/** A subclass may implement this factory function to work with the GPU backend. If the return
is non-NULL then the caller owns a ref on the returned object.
*/
- virtual GrEffect* asNewEffect(GrContext*) const;
+ virtual GrEffectRef* asNewEffect(GrContext*) const;
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
protected:
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index ea38137b85..196d788580 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -17,7 +17,7 @@ class SkMatrix;
struct SkIPoint;
struct SkIRect;
struct SkRect;
-class GrEffect;
+class GrEffectRef;
class GrTexture;
/**
@@ -93,7 +93,7 @@ public:
* The effect can assume its vertexCoords space maps 1-to-1 with texels
* in the texture.
*/
- virtual bool asNewEffect(GrEffect** effect, GrTexture*) const;
+ virtual bool asNewEffect(GrEffectRef** effect, GrTexture*) const;
/**
* Returns true if the filter can be processed on the GPU. This is most
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 128cfa4dc3..14a4a45f2d 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -92,14 +92,14 @@
///////////////////////////////////////////////////////////////////////////////
#ifndef SkNEW
- #define SkNEW(type_name) new type_name
- #define SkNEW_ARGS(type_name, args) new type_name args
- #define SkNEW_ARRAY(type_name, count) new type_name[count]
- #define SkNEW_PLACEMENT(buf, type_name) new (buf) type_name
+ #define SkNEW(type_name) (new type_name)
+ #define SkNEW_ARGS(type_name, args) (new type_name args)
+ #define SkNEW_ARRAY(type_name, count) (new type_name[(count)])
+ #define SkNEW_PLACEMENT(buf, type_name) (new (buf) type_name)
#define SkNEW_PLACEMENT_ARGS(buf, type_name, args) \
- new (buf) type_name args
- #define SkDELETE(obj) delete obj
- #define SkDELETE_ARRAY(array) delete[] array
+ (new (buf) type_name args)
+ #define SkDELETE(obj) (delete (obj))
+ #define SkDELETE_ARRAY(array) (delete[] (array))
#endif
#ifndef SK_CRASH
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 899e3b6122..faa795fba4 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -18,8 +18,7 @@
class SkPath;
class GrContext;
-class GrEffect;
-class GrEffectStage;
+class GrEffectRef;
/** \class SkShader
*
@@ -322,7 +321,7 @@ public:
* The GrContext may be used by the effect to create textures. The GPU device does not call
* setContext. Instead we pass the paint here in case the shader needs paint info.
*/
- virtual GrEffect* asNewEffect(GrContext* context, const SkPaint& paint) const;
+ virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint) const;
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders