diff options
author | Hans Wennborg <hans@chromium.org> | 2017-12-08 15:31:34 -0800 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-09 01:31:48 +0000 |
commit | 42b6cffaad4897d1d5a45bf9087a3b1a881591f4 (patch) | |
tree | ba4b941c0c6909a423906061950b8e1bd023922b | |
parent | 0933bc9b679457ef9333988fe3a1faae6a0b4126 (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>
-rw-r--r-- | include/private/GrTypesPriv.h | 2 | ||||
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h index 2da1f86b19..a3e9014f47 100644 --- a/include/private/GrTypesPriv.h +++ b/include/private/GrTypesPriv.h @@ -24,8 +24,6 @@ using GrStdSteadyClock = std::chrono::monotonic_clock; using GrStdSteadyClock = std::chrono::steady_clock; #endif -static constexpr GrSurfaceOrigin kGrUnknownSurfaceOrigin = static_cast<GrSurfaceOrigin>(-1); - /** This enum is used to specify the load operation to be used when an * opList/GrGpuCommandBuffer begins execution. */ 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)); } |