aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrSamplerState.h3
-rw-r--r--src/gpu/SkGpuDevice.cpp11
-rw-r--r--src/gpu/gl/GrGpuGL_program.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h
index fb59111d14..f52775de74 100644
--- a/include/gpu/GrSamplerState.h
+++ b/include/gpu/GrSamplerState.h
@@ -165,8 +165,9 @@ public:
this->reset(kDefault_WrapMode, kDefault_Filter, GrMatrix::I());
}
- void setCustomStage(GrCustomStage* stage) {
+ GrCustomStage* setCustomStage(GrCustomStage* stage) {
GrSafeAssign(fCustomStage, stage);
+ return stage;
}
GrCustomStage* getCustomStage() const { return fCustomStage; }
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index de9d9737df..056c5d8179 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -540,15 +540,16 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
GrSamplerState* sampler = grPaint->textureSampler(kShaderTextureIdx);
switch (bmptype) {
case SkShader::kRadial_BitmapType: {
- sampler->setCustomStage(new GrRadialGradient());
+ sampler->setCustomStage(new GrRadialGradient())->unref();
} break;
case SkShader::kSweep_BitmapType: {
- sampler->setCustomStage(new GrSweepGradient());
+ sampler->setCustomStage(new GrSweepGradient())->unref();
} break;
case SkShader::kTwoPointRadial_BitmapType: {
- sampler->setCustomStage(new GrRadial2Gradient(twoPointParams[0],
- twoPointParams[1],
- twoPointParams[2] < 0));
+ sampler->setCustomStage(new
+ GrRadial2Gradient(twoPointParams[0],
+ twoPointParams[1],
+ twoPointParams[2] < 0))->unref();
} break;
default:
break;
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index c230d40118..30c542232f 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -7,8 +7,6 @@
#include "GrGpuGL.h"
-#include "effects/GrGradientEffects.h"
-
#include "GrCustomStage.h"
#include "GrGLProgramStage.h"
#include "GrGpuVertex.h"