aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-29 19:51:22 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-29 19:51:22 +0000
commit2eaaefd7e6a58339b3f93333f1e9cc92252cc303 (patch)
treef65a31a9b3bc70909ceb311ebad684c2bf445868 /src/effects/gradients
parent484ee2a5fe47c204d9dda6acba54f9789d1cf69f (diff)
Pass GrCustomStage to key-generation functions and emitCode().
R=robertphillips@google.com Review URL: https://codereview.appspot.com/6819046 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6182 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp8
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp8
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp8
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp12
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp12
5 files changed, 29 insertions, 19 deletions
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 0e08ec067d..524db76966 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -474,6 +474,8 @@ void SkLinearGradient::shadeSpan16(int x, int y,
#if SK_SUPPORT_GPU
+#include "GrTBackendEffectFactory.h"
+
/////////////////////////////////////////////////////////////////////
class GrGLLinearGradient : public GrGLGradientEffect {
@@ -486,14 +488,14 @@ public:
virtual ~GrGLLinearGradient() { }
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
- static EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps) { return 0; }
+ static EffectKey GenKey(const GrEffectStage&, const GrGLCaps& caps) { return 0; }
private:
@@ -551,7 +553,7 @@ GrEffect* GrLinearGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 6fa29a79c5..4766af604b 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -473,6 +473,8 @@ void SkRadialGradient::shadeSpan(int x, int y,
#if SK_SUPPORT_GPU
+#include "GrTBackendEffectFactory.h"
+
class GrGLRadialGradient : public GrGLGradientEffect {
public:
@@ -481,14 +483,14 @@ public:
virtual ~GrGLRadialGradient() { }
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
- static EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps) { return 0; }
+ static EffectKey GenKey(const GrEffectStage&, const GrGLCaps& caps) { return 0; }
private:
@@ -549,7 +551,7 @@ GrEffect* GrRadialGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b264075c12..b64e15d0c1 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -382,6 +382,8 @@ void SkSweepGradient::shadeSpan16(int x, int y, uint16_t* SK_RESTRICT dstC,
#if SK_SUPPORT_GPU
+#include "GrTBackendEffectFactory.h"
+
class GrGLSweepGradient : public GrGLGradientEffect {
public:
@@ -390,14 +392,14 @@ public:
virtual ~GrGLSweepGradient() { }
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
- static EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps) { return 0; }
+ static EffectKey GenKey(const GrEffectStage&, const GrGLCaps& caps) { return 0; }
private:
@@ -455,7 +457,7 @@ GrEffect* GrSweepGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLSweepGradient::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 396981f598..acd0eeedfb 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -315,6 +315,8 @@ void SkTwoPointConicalGradient::flatten(
#if SK_SUPPORT_GPU
+#include "GrTBackendEffectFactory.h"
+
// For brevity
typedef GrGLUniformManager::UniformHandle UniformHandle;
static const UniformHandle kInvalidUniformHandle = GrGLUniformManager::kInvalidUniformHandle;
@@ -327,7 +329,7 @@ public:
virtual ~GrGLConical2Gradient() { }
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
@@ -335,7 +337,7 @@ public:
const TextureSamplerArray&) SK_OVERRIDE;
virtual void setData(const GrGLUniformManager&, const GrEffectStage&) SK_OVERRIDE;
- static EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps);
+ static EffectKey GenKey(const GrEffectStage&, const GrGLCaps& caps);
protected:
@@ -466,7 +468,7 @@ GrGLConical2Gradient::GrGLConical2Gradient(
}
void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
@@ -666,8 +668,8 @@ void GrGLConical2Gradient::setData(const GrGLUniformManager& uman, const GrEffec
}
}
-GrEffect::EffectKey GrGLConical2Gradient::GenKey(const GrEffect& s, const GrGLCaps& caps) {
- return (static_cast<const GrConical2Gradient&>(s).isDegenerate());
+GrGLEffect::EffectKey GrGLConical2Gradient::GenKey(const GrEffectStage& s, const GrGLCaps&) {
+ return (static_cast<const GrConical2Gradient&>(*s.getEffect()).isDegenerate());
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 2aac6677f4..9357b11685 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -349,6 +349,8 @@ void SkTwoPointRadialGradient::init() {
#if SK_SUPPORT_GPU
+#include "GrTBackendEffectFactory.h"
+
// For brevity
typedef GrGLUniformManager::UniformHandle UniformHandle;
static const UniformHandle kInvalidUniformHandle = GrGLUniformManager::kInvalidUniformHandle;
@@ -362,7 +364,7 @@ public:
virtual ~GrGLRadial2Gradient() { }
virtual void emitCode(GrGLShaderBuilder*,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
@@ -370,7 +372,7 @@ public:
const TextureSamplerArray&) SK_OVERRIDE;
virtual void setData(const GrGLUniformManager&, const GrEffectStage&) SK_OVERRIDE;
- static EffectKey GenKey(const GrEffect& s, const GrGLCaps& caps);
+ static EffectKey GenKey(const GrEffectStage&, const GrGLCaps& caps);
protected:
@@ -499,7 +501,7 @@ GrGLRadial2Gradient::GrGLRadial2Gradient(
}
void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
- const GrEffect&,
+ const GrEffectStage&,
EffectKey,
const char* vertexCoords,
const char* outputColor,
@@ -640,8 +642,8 @@ void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman, const GrEffect
}
}
-GrEffect::EffectKey GrGLRadial2Gradient::GenKey(const GrEffect& s, const GrGLCaps& caps) {
- return (static_cast<const GrRadial2Gradient&>(s).isDegenerate());
+GrGLEffect::EffectKey GrGLRadial2Gradient::GenKey(const GrEffectStage& s, const GrGLCaps&) {
+ return (static_cast<const GrRadial2Gradient&>(*s.getEffect()).isDegenerate());
}
/////////////////////////////////////////////////////////////////////