aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-02-28 16:11:04 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-28 21:49:28 +0000
commitdac5f6bcbec7130a209a6899444feb022719498d (patch)
treedd552f45427514aca6a1a9be7c1c771de4292706
parent621491e07eb66aee428db06173e27bbae7e9086a (diff)
Fix -Wshadow-field warnings
BUG=skia: Change-Id: I44f1e11787eab88bdc5ed25c34ea802e9001d427 Reviewed-on: https://skia-review.googlesource.com/9083 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
-rw-r--r--bench/RectBench.cpp12
-rw-r--r--include/private/GrRenderTargetProxy.h4
-rw-r--r--src/gpu/GrRenderTargetProxy.cpp14
-rw-r--r--tools/gpu/GrTest.cpp2
4 files changed, 15 insertions, 17 deletions
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index 48764cabdf..38a78dfce5 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -29,7 +29,6 @@ public:
: fShift(shift)
, fStroke(stroke) {}
- SkString fName;
const char* computeName(const char root[]) {
fName.printf("%s_%d", root, fShift);
if (fStroke > 0) {
@@ -41,6 +40,8 @@ public:
bool isVisual() override { return true; }
protected:
+ SkString fName;
+
virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {
c->drawRect(r, p);
}
@@ -103,7 +104,6 @@ protected:
}
private:
- SkString fName;
SkBlendMode fMode;
typedef RectBench INHERITED;
@@ -127,8 +127,6 @@ protected:
}
private:
- SkString fName;
-
typedef RectBench INHERITED;
};
@@ -156,7 +154,6 @@ protected:
class PointsBench : public RectBench {
public:
SkCanvas::PointMode fMode;
- const char* fName;
PointsBench(SkCanvas::PointMode mode, const char* name)
: RectBench(2)
@@ -188,7 +185,7 @@ protected:
}
}
}
- const char* onGetName() override { return fName; }
+ const char* onGetName() override { return fName.c_str(); }
};
/*******************************************************************************
@@ -204,7 +201,6 @@ public:
KMaskShader
};
SkCanvas::PointMode fMode;
- const char* fName;
BlitMaskBench(SkCanvas::PointMode mode,
BlitMaskBench::kMaskType type, const char* name) :
@@ -262,7 +258,7 @@ protected:
}
}
}
- const char* onGetName() override { return fName; }
+ const char* onGetName() override { return fName.c_str(); }
private:
typedef RectBench INHERITED;
kMaskType _type;
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index 63f0c21b52..3bf506c951 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -32,7 +32,7 @@ public:
* For our purposes, "Mixed Sampled" means the stencil buffer is multisampled but the color
* buffer is not.
*/
- bool isMixedSampled() const { return fFlags & GrRenderTarget::Flags::kMixedSampled; }
+ bool isMixedSampled() const { return fRenderTargetFlags & GrRenderTarget::Flags::kMixedSampled; }
/**
* "Unified Sampled" means the stencil and color buffers are both multisampled.
@@ -78,7 +78,7 @@ private:
// we know the newly created render target will be internal, we are able to precompute what the
// flags will ultimately end up being. In the wrapped case we just copy the wrapped
// rendertarget's info here.
- GrRenderTarget::Flags fFlags;
+ GrRenderTarget::Flags fRenderTargetFlags;
typedef GrSurfaceProxy INHERITED;
};
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index b3328ab638..34d67be3ef 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -20,25 +20,27 @@
GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrSurfaceDesc& desc,
SkBackingFit fit, SkBudgeted budgeted, uint32_t flags)
: INHERITED(desc, fit, budgeted, flags)
- , fFlags(GrRenderTarget::Flags::kNone) {
+ , fRenderTargetFlags(GrRenderTarget::Flags::kNone) {
// Since we know the newly created render target will be internal, we are able to precompute
// what the flags will ultimately end up being.
if (caps.usesMixedSamples() && fDesc.fSampleCnt > 0) {
- fFlags |= GrRenderTarget::Flags::kMixedSampled;
+ fRenderTargetFlags |= GrRenderTarget::Flags::kMixedSampled;
}
if (caps.maxWindowRectangles() > 0) {
- fFlags |= GrRenderTarget::Flags::kWindowRectsSupport;
+ fRenderTargetFlags |= GrRenderTarget::Flags::kWindowRectsSupport;
}
}
// Wrapped version
GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf)
: INHERITED(std::move(surf), SkBackingFit::kExact)
- , fFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) {
+ , fRenderTargetFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) {
}
int GrRenderTargetProxy::maxWindowRectangles(const GrCaps& caps) const {
- return (fFlags & GrRenderTarget::Flags::kWindowRectsSupport) ? caps.maxWindowRectangles() : 0;
+ return (fRenderTargetFlags & GrRenderTarget::Flags::kWindowRectsSupport)
+ ? caps.maxWindowRectangles()
+ : 0;
}
GrRenderTarget* GrRenderTargetProxy::instantiate(GrTextureProvider* texProvider) {
@@ -50,7 +52,7 @@ GrRenderTarget* GrRenderTargetProxy::instantiate(GrTextureProvider* texProvider)
}
// Check that our a priori computation matched the ultimate reality
- SkASSERT(fFlags == surf->asRenderTarget()->renderTargetPriv().flags());
+ SkASSERT(fRenderTargetFlags == surf->asRenderTarget()->renderTargetPriv().flags());
return surf->asRenderTarget();
}
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index 204119c166..da4f8eb377 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -252,7 +252,7 @@ void GrRenderTargetContextPriv::testingOnly_addDrawOp(GrPaint&& paint,
///////////////////////////////////////////////////////////////////////////////
GrRenderTarget::Flags GrRenderTargetProxy::testingOnly_getFlags() const {
- return fFlags;
+ return fRenderTargetFlags;
}
///////////////////////////////////////////////////////////////////////////////