From 42b6cffaad4897d1d5a45bf9087a3b1a881591f4 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 8 Dec 2017 15:31:34 -0800 Subject: 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 Commit-Queue: Chris Dalton --- src/gpu/GrSurfaceProxy.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/gpu') 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)); } -- cgit v1.2.3