aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrSamplerState.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-16 15:19:45 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-16 15:19:45 +0000
commitdfdb7e5240276493077b7c6e1f3cc8b8a0e195ba (patch)
tree8052c43cb50ba6f2c5c2f8fb9a3c518e17b43d2c /include/gpu/GrSamplerState.h
parentf6eac8af585e44d56e6b18d269e6c34f9917ea88 (diff)
Reland r5963 with two fixes:
Missing ref in GrSweepGradient::TestCreate. Must reset() the sampler in setup_drawstate_aaclip() to avoid hitting a (dubious) assert. git-svn-id: http://skia.googlecode.com/svn/trunk@5964 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrSamplerState.h')
-rw-r--r--include/gpu/GrSamplerState.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h
index 385dba7bdd..da52e95277 100644
--- a/include/gpu/GrSamplerState.h
+++ b/include/gpu/GrSamplerState.h
@@ -19,14 +19,7 @@
class GrSamplerState {
public:
- static const bool kBilerpDefault = false;
- static const SkShader::TileMode kTileModeDefault = SkShader::kClamp_TileMode;
-
- /**
- * Default sampler state is set to clamp, use normal sampling mode, be
- * unfiltered, and use identity matrix.
- */
GrSamplerState()
: fCustomStage (NULL) {
memset(this, 0, sizeof(GrSamplerState));
@@ -63,12 +56,6 @@ public:
const GrMatrix& getMatrix() const { return fMatrix; }
/**
- * Access the sampler's matrix. See SampleMode for explanation of
- * relationship between the matrix and sample mode.
- */
- GrMatrix* matrix() { return &fMatrix; }
-
- /**
* Multiplies the current sampler matrix a matrix
*
* After this call M' = M*m where M is the old matrix, m is the parameter
@@ -80,10 +67,10 @@ public:
*/
void preConcatMatrix(const GrMatrix& matrix) { fMatrix.preConcat(matrix); }
- void reset(const GrMatrix& matrix) {
- fMatrix = matrix;
- GrSafeSetNull(fCustomStage);
- }
+ /**
+ * Do not call this function. It will be removed soon.
+ */
+ void setMatrixDeprecated(const GrMatrix& matrix) { fMatrix = matrix; }
void reset() {
fMatrix.reset();
@@ -92,8 +79,16 @@ public:
GrCustomStage* setCustomStage(GrCustomStage* stage) {
GrSafeAssign(fCustomStage, stage);
+ fMatrix.reset();
return stage;
}
+
+ GrCustomStage* setCustomStage(GrCustomStage* stage, const GrMatrix& matrix) {
+ GrSafeAssign(fCustomStage, stage);
+ fMatrix = matrix;
+ return stage;
+ }
+
const GrCustomStage* getCustomStage() const { return fCustomStage; }
private: