aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrTextureDomain.cpp
diff options
context:
space:
mode:
authorGravatar Hans Wennborg <hans@chromium.org>2017-12-08 18:56:23 -0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-09 04:28:39 +0000
commitc63ec5ca64074dcc264a43bd1c1fdfb26e009410 (patch)
tree8a3993a3c9356f949a35d5ea9901a530417b5399 /src/gpu/effects/GrTextureDomain.cpp
parent25eef6b342a007f76802950a683b4a339761c42e (diff)
Fix tautological comparison in GrTextureDomain.cpp
-1 is not a valid value for the GrTextureDomain::Mode enum, so certain versions of Clang warn that the comparison is a no-op: ../../third_party/skia/src/gpu/effects/GrTextureDomain.cpp:70:23: warning: comparison of constant -1 with expression of type 'GrTextureDomain::Mode' is always false [-Wtautological-constant-out-of-range-compare] SkASSERT((Mode)-1 == fMode || textureDomain.mode() == fMode); ~~~~~~~~ ^ ~~~~~ Bug: chromium:793189 Change-Id: Iba49ae15622285a62ad218dbdd78b0846338b7cb Reviewed-on: https://skia-review.googlesource.com/82962 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/effects/GrTextureDomain.cpp')
-rw-r--r--src/gpu/effects/GrTextureDomain.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index e1da72135d..02746cfd45 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -67,8 +67,9 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
const SkString& inCoords,
GrGLSLFragmentProcessor::SamplerHandle sampler,
const char* inModulateColor) {
- SkASSERT((Mode)-1 == fMode || textureDomain.mode() == fMode);
+ SkASSERT(!fHasMode || textureDomain.mode() == fMode);
SkDEBUGCODE(fMode = textureDomain.mode();)
+ SkDEBUGCODE(fHasMode = true;)
if (textureDomain.mode() != kIgnore_Mode && !fDomainUni.isValid()) {
const char* name;
@@ -160,7 +161,7 @@ void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
const GrTextureDomain& textureDomain,
GrSurfaceProxy* proxy) {
GrTexture* tex = proxy->priv().peekTexture();
- SkASSERT(textureDomain.mode() == fMode);
+ SkASSERT(fHasMode && textureDomain.mode() == fMode);
if (kIgnore_Mode != textureDomain.mode()) {
SkScalar wInv = SK_Scalar1 / tex->width();
SkScalar hInv = SK_Scalar1 / tex->height();