aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrTextureAccess.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 15:37:30 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 15:37:30 +0000
commitdb545aec7267b10f1cb925204862f7e16753b724 (patch)
tree535b3996b7203bd2fb970b7ddaaf9f5953eb93f8 /include/gpu/GrTextureAccess.h
parent81f9d2e05be4902993345dac93337158345c660b (diff)
Fix GrTextureAccess::operator ==
compare the textures, correctly intepret memcmp result, don't compare last byte of swizzle array which must be 0. BUG=895 Review URL: https://codereview.appspot.com/6542048 git-svn-id: http://skia.googlecode.com/svn/trunk@5605 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrTextureAccess.h')
-rw-r--r--include/gpu/GrTextureAccess.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index 7f47b6e792..0d0860f2fe 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -145,11 +145,12 @@ public:
bool operator== (const GrTextureAccess& other) const {
#if GR_DEBUG
// below assumes all chars in fSwizzle are initialized even if string is < 4 chars long.
- GrAssert(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)) ==
+ GrAssert(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) ==
strcmp(fSwizzle, other.fSwizzle));
#endif
return fParams == other.fParams &&
- memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle));
+ (fTexture.get() == other.fTexture.get()) &&
+ (0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1));
}
bool operator!= (const GrTextureAccess& other) const { return !(*this == other); }