summaryrefslogtreecommitdiff
path: root/gpu/GrTextureAccess.cpp
diff options
context:
space:
mode:
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-28 13:46:42 +0000
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-28 13:46:42 +0000
commitc3abb7baff528b64f175e08350a92a0d72ca24be (patch)
tree1c7d5f5add169b4b6dcbef689beae307510f114f /gpu/GrTextureAccess.cpp
parentf99c97497d5b682825a2dade1892d6466227e74c (diff)
downloadsrc-c3abb7baff528b64f175e08350a92a0d72ca24be.tar.gz
Make GrGLShaderBuilder::TextureSampler extract only required info from GrTextureAccess.
This will make it possible to init a TextureSampler without a texture or a specific config. Also unify two separate bitfields of color components in GPU code. Review URL: https://codereview.chromium.org/13121002 git-svn-id: http://skia.googlecode.com/svn/trunk/src@8428 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/GrTextureAccess.cpp')
-rw-r--r--gpu/GrTextureAccess.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gpu/GrTextureAccess.cpp b/gpu/GrTextureAccess.cpp
index 5c3a36dc..499b1f23 100644
--- a/gpu/GrTextureAccess.cpp
+++ b/gpu/GrTextureAccess.cpp
@@ -6,7 +6,7 @@
*/
#include "GrTextureAccess.h"
-
+#include "GrColor.h"
#include "GrTexture.h"
GrTextureAccess::GrTextureAccess() {
@@ -68,7 +68,7 @@ void GrTextureAccess::reset(GrTexture* texture,
fTexture.reset(SkRef(texture));
fParams = params;
memcpy(fSwizzle, "rgba", 5);
- fSwizzleMask = (kRGB_SwizzleMask | kA_SwizzleFlag);
+ fSwizzleMask = kRGBA_GrColorComponentFlags;
}
void GrTextureAccess::reset(GrTexture* texture,
@@ -78,7 +78,7 @@ void GrTextureAccess::reset(GrTexture* texture,
fTexture.reset(SkRef(texture));
fParams.reset(tileXAndY, bilerp);
memcpy(fSwizzle, "rgba", 5);
- fSwizzleMask = (kRGB_SwizzleMask | kA_SwizzleFlag);
+ fSwizzleMask = kRGBA_GrColorComponentFlags;
}
void GrTextureAccess::setSwizzle(const char* swizzle) {
@@ -88,16 +88,16 @@ void GrTextureAccess::setSwizzle(const char* swizzle) {
fSwizzle[i] = swizzle[i];
switch (swizzle[i]) {
case 'r':
- fSwizzleMask |= kR_SwizzleFlag;
+ fSwizzleMask |= kR_GrColorComponentFlag;
break;
case 'g':
- fSwizzleMask |= kG_SwizzleFlag;
+ fSwizzleMask |= kG_GrColorComponentFlag;
break;
case 'b':
- fSwizzleMask |= kB_SwizzleFlag;
+ fSwizzleMask |= kB_GrColorComponentFlag;
break;
case 'a':
- fSwizzleMask |= kA_SwizzleFlag;
+ fSwizzleMask |= kA_GrColorComponentFlag;
break;
default:
GrCrash("Unexpected swizzle string character.");