summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 14:55:39 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 14:55:39 +0000
commit61c9369b931a76d03a5915fa407122e89c54d480 (patch)
treef97245ce361316f5d258d69996920763c6a74059
parent01b0da4230d5ffe8a656a413058037194606d45f (diff)
downloadinclude-61c9369b931a76d03a5915fa407122e89c54d480.tar.gz
Move SkShader::fLocalMatrix into SkShader constructor.
As a first step towards removing SkShader::setLocalMatrix, which will make SkShader thread-safe, remove calls to setLocalMatrix that happen immediately after the shader is being created. Instead, pass the matrix into the constructor or factory method. BUG=skia:1976 R=scroggo@google.com, reed@google.com, skyostil@google.com, mtklein@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/245963010 git-svn-id: http://skia.googlecode.com/svn/trunk/include@14401 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--core/SkShader.h5
-rw-r--r--effects/SkGradientShader.h15
2 files changed, 13 insertions, 7 deletions
diff --git a/core/SkShader.h b/core/SkShader.h
index cc2cc75..4af8f78 100644
--- a/core/SkShader.h
+++ b/core/SkShader.h
@@ -34,7 +34,7 @@ class SK_API SkShader : public SkFlattenable {
public:
SK_DECLARE_INST_COUNT(SkShader)
- SkShader();
+ SkShader(const SkMatrix* localMatrix = NULL);
virtual ~SkShader();
/**
@@ -371,7 +371,8 @@ public:
* @return Returns a new shader object. Note: this function never returns null.
*/
static SkShader* CreateBitmapShader(const SkBitmap& src,
- TileMode tmx, TileMode tmy);
+ TileMode tmx, TileMode tmy,
+ const SkMatrix* localMatrix = NULL);
/** Call this to create a new shader that will draw with the specified picture.
*
diff --git a/effects/SkGradientShader.h b/effects/SkGradientShader.h
index ed0f1bf..871b34a 100644
--- a/effects/SkGradientShader.h
+++ b/effects/SkGradientShader.h
@@ -49,7 +49,8 @@ public:
const SkColor colors[], const SkScalar pos[], int count,
SkShader::TileMode mode,
SkUnitMapper* mapper = NULL,
- uint32_t flags = 0);
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
/** Returns a shader that generates a radial gradient given the center and radius.
<p />
@@ -72,7 +73,8 @@ public:
const SkColor colors[], const SkScalar pos[], int count,
SkShader::TileMode mode,
SkUnitMapper* mapper = NULL,
- uint32_t flags = 0);
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
/** Returns a shader that generates a radial gradient given the start position, start radius, end position and end radius.
<p />
@@ -102,7 +104,8 @@ public:
const SkScalar pos[], int count,
SkShader::TileMode mode,
SkUnitMapper* mapper = NULL,
- uint32_t flags = 0);
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
/**
* Returns a shader that generates a conical gradient given two circles, or
@@ -118,7 +121,8 @@ public:
const SkScalar pos[], int count,
SkShader::TileMode mode,
SkUnitMapper* mapper = NULL,
- uint32_t flags = 0);
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
/** Returns a shader that generates a sweep gradient given a center.
<p />
@@ -139,7 +143,8 @@ public:
static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
const SkColor colors[], const SkScalar pos[],
int count, SkUnitMapper* mapper = NULL,
- uint32_t flags = 0);
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
};