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-08-20 19:22:38 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-20 19:22:38 +0000
commit0342a85091fd430c90a142d155dc9642aa729d9e (patch)
treead84edb6b6194b35ca77783c7147c2e62a56542f /include/gpu/GrSamplerState.h
parentb7961193a3ecca44cf2650d9e446ebaa10b1583d (diff)
Remove _UPM_ GrPixelConfigs
Review URL: http://codereview.appspot.com/6460113/ git-svn-id: http://skia.googlecode.com/svn/trunk@5196 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrSamplerState.h')
-rw-r--r--include/gpu/GrSamplerState.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h
index dcd5b66283..f87b9b4e10 100644
--- a/include/gpu/GrSamplerState.h
+++ b/include/gpu/GrSamplerState.h
@@ -130,6 +130,7 @@ public:
const GrMatrix& getMatrix() const { return fMatrix; }
bool swapsRAndB() const { return fSwapRAndB; }
+ bool premultiply() const { return fPremultiply; }
GrTextureParams* textureParams() { return &fTextureParams; }
const GrTextureParams& getTextureParams() const { return fTextureParams; }
@@ -146,6 +147,12 @@ public:
void setRAndBSwap(bool swap) { fSwapRAndB = swap; }
/**
+ * If the texture is RGBA/BGRA 8888 config then its rgb components will be
+ * multiplied by its a component after the texture read.
+ **/
+ void setPremultiply(bool premul) { fPremultiply = premul; }
+
+ /**
* Multiplies the current sampler matrix a matrix
*
* After this call M' = M*m where M is the old matrix, m is the parameter
@@ -163,6 +170,7 @@ public:
fTextureParams.reset(tileXAndY, filter);
fMatrix = matrix;
fSwapRAndB = false;
+ fPremultiply = false;
GrSafeSetNull(fCustomStage);
}
void reset(SkShader::TileMode wrapXAndY, bool filter) {
@@ -184,6 +192,7 @@ public:
private:
GrTextureParams fTextureParams;
bool fSwapRAndB;
+ bool fPremultiply; // temporary, will be replaced soon by a custom stage.
GrMatrix fMatrix;
GrCustomStage* fCustomStage;