aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Hans Wennborg <hans@chromium.org>2017-12-08 15:31:34 -0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-09 01:31:48 +0000
commit42b6cffaad4897d1d5a45bf9087a3b1a881591f4 (patch)
treeba4b941c0c6909a423906061950b8e1bd023922b /src/gpu
parent0933bc9b679457ef9333988fe3a1faae6a0b4126 (diff)
Fix tautological compare in GrSurfaceProxy.cpp
-1 is not a valid value for the GrSurfaceOrigin enum, and certain versions of Clang warn that the comparison is effectively a no-op: ../../third_party/skia/src/gpu/GrSurfaceProxy.cpp:547:38: warning: comparison of constant -1 with expression of type 'GrSurfaceOrigin' is always true [-Wtautological-constant-out-of-range-compare] SkASSERT(kGrUnknownSurfaceOrigin != fProxy->origin()); ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~ Instead of trying to force -1 in there, drop the assert and initialize with top-left as origin. Bug: chromium:793189 Change-Id: I4cb6720d567f6c5650a19df33d3c77f2d738a516 Reviewed-on: https://skia-review.googlesource.com/82961 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index a5c2be622b..2bcd923a62 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -26,7 +26,7 @@ GrSurfaceProxy::GrSurfaceProxy(LazyInstantiateCallback&& callback, GrPixelConfig
: fConfig(config)
, fWidth(-1) // Width, height, and origin will be initialized upon lazy instantiation.
, fHeight(-1)
- , fOrigin(kGrUnknownSurfaceOrigin)
+ , fOrigin(kTopLeft_GrSurfaceOrigin)
, fFit(SkBackingFit::kApprox)
, fBudgeted(SkBudgeted::kYes)
, fFlags(GrResourceProvider::kNoPendingIO_Flag)
@@ -544,9 +544,6 @@ void GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide
fProxy->fHeight = texture->height();
SkASSERT(texture->config() == fProxy->fConfig);
- SkASSERT(kGrUnknownSurfaceOrigin != fProxy->origin());
- SkASSERT(kTopLeft_GrSurfaceOrigin == fProxy->fOrigin ||
- kBottomLeft_GrSurfaceOrigin == fProxy->fOrigin);
SkDEBUGCODE(fProxy->validateLazyTexture(texture.get());)
this->assign(std::move(texture));
}