aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-09-14 14:11:24 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-14 20:39:42 +0000
commitf1748f5a9238a0d3e189d50fc5e57ae8b8ec087c (patch)
treecaff30803c0b92b567f9c8dc9cdb7610389684af
parent7d76ed2b1be9f5dcc1acca311d47829cd03d52f8 (diff)
Change visitProxies signature
There is a perf regression (mainly on the Nexus5) for the https://skia-review.googlesource.com/c/skia/+/46200 (Add method to iterate over a GrOp's GrSurfaceProxies) This is one candidate. Change-Id: I995d3a88bad2a914f24b49512abbf01aeaf579c8 Reviewed-on: https://skia-review.googlesource.com/46586 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
-rw-r--r--gm/beziereffects.cpp2
-rw-r--r--gm/convexpolyeffect.cpp2
-rw-r--r--src/gpu/GrAppliedClip.h2
-rw-r--r--src/gpu/GrFragmentProcessor.h2
-rw-r--r--src/gpu/GrProcessorSet.h2
-rw-r--r--src/gpu/ccpr/GrCoverageCountingPathRenderer.h2
-rw-r--r--src/gpu/instanced/InstancedOp.h2
-rw-r--r--src/gpu/ops/GrAAConvexPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrAAFillRectOp.cpp2
-rw-r--r--src/gpu/ops/GrAAHairLinePathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrAAStrokeRectOp.cpp2
-rw-r--r--src/gpu/ops/GrAtlasTextOp.h2
-rw-r--r--src/gpu/ops/GrCopySurfaceOp.h2
-rw-r--r--src/gpu/ops/GrDashOp.cpp2
-rw-r--r--src/gpu/ops/GrDefaultPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrDrawAtlasOp.h2
-rw-r--r--src/gpu/ops/GrDrawPathOp.h2
-rw-r--r--src/gpu/ops/GrDrawVerticesOp.h2
-rw-r--r--src/gpu/ops/GrLatticeOp.cpp2
-rw-r--r--src/gpu/ops/GrMSAAPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrNonAAFillRectOp.cpp4
-rw-r--r--src/gpu/ops/GrNonAAStrokeRectOp.cpp2
-rw-r--r--src/gpu/ops/GrOp.h2
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp10
-rw-r--r--src/gpu/ops/GrRegionOp.cpp2
-rw-r--r--src/gpu/ops/GrSimpleMeshDrawOpHelper.h2
-rw-r--r--src/gpu/ops/GrSmallPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrTessellatingPathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrTextureOp.cpp2
-rw-r--r--tests/OnFlushCallbackTest.cpp2
-rw-r--r--tests/ProcessorTest.cpp2
32 files changed, 37 insertions, 37 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 7528df35e4..b66ea42acf 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -33,7 +33,7 @@ public:
return analysis.requiresDstTexture() ? RequiresDstTexture::kYes : RequiresDstTexture::kNo;
}
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessorSet.visitProxies(func);
}
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index ab9a4d08d0..a4fb5e53d5 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -48,7 +48,7 @@ public:
const char* name() const override { return "PolyBoundsOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessors.visitProxies(func);
}
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h
index e942baa6a2..92cd45be10 100644
--- a/src/gpu/GrAppliedClip.h
+++ b/src/gpu/GrAppliedClip.h
@@ -82,7 +82,7 @@ public:
}
bool operator!=(const GrAppliedClip& that) const { return !(*this == that); }
- void visitProxies(std::function<void(GrSurfaceProxy*)> func) const {
+ void visitProxies(const std::function<void(GrSurfaceProxy*)>& func) const {
if (fClipCoverageFP) {
fClipCoverageFP->visitProxies(func);
}
diff --git a/src/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h
index 44a69f6ed3..3237684eb3 100644
--- a/src/gpu/GrFragmentProcessor.h
+++ b/src/gpu/GrFragmentProcessor.h
@@ -241,7 +241,7 @@ public:
&GrResourceIOProcessor::numTextureSamplers,
&GrResourceIOProcessor::textureSampler>;
- void visitProxies(std::function<void(GrSurfaceProxy*)> func) {
+ void visitProxies(const std::function<void(GrSurfaceProxy*)>& func) {
GrFragmentProcessor::TextureAccessIter iter(this);
while (const GrResourceIOProcessor::TextureSampler* sampler = iter.next()) {
func(sampler->proxy());
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h
index 67269eb140..05d0a59ab2 100644
--- a/src/gpu/GrProcessorSet.h
+++ b/src/gpu/GrProcessorSet.h
@@ -152,7 +152,7 @@ public:
SkString dumpProcessors() const;
- void visitProxies(std::function<void(GrSurfaceProxy*)> func) const {
+ void visitProxies(const std::function<void(GrSurfaceProxy*)>& func) const {
for (int i = 0; i < this->numFragmentProcessors(); ++i) {
GrFragmentProcessor::TextureAccessIter iter(this->fragmentProcessor(i));
while (const GrResourceIOProcessor::TextureSampler* sampler = iter.next()) {
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index 8cbad488f6..e339c6854a 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -57,7 +57,7 @@ public:
const char* name() const override { return "GrCoverageCountingPathRenderer::DrawPathsOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessors.visitProxies(func);
}
diff --git a/src/gpu/instanced/InstancedOp.h b/src/gpu/instanced/InstancedOp.h
index ae70e54130..d0eb095d6f 100644
--- a/src/gpu/instanced/InstancedOp.h
+++ b/src/gpu/instanced/InstancedOp.h
@@ -28,7 +28,7 @@ public:
~InstancedOp() override;
const char* name() const override { return "InstancedOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessors.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 95b3907812..91b54c8d01 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -751,7 +751,7 @@ public:
const char* name() const override { return "AAConvexPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp
index f3718443f7..4c91d7cccd 100644
--- a/src/gpu/ops/GrAAFillRectOp.cpp
+++ b/src/gpu/ops/GrAAFillRectOp.cpp
@@ -201,7 +201,7 @@ public:
const char* name() const override { return "AAFillRectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index d5dfa2dda8..8881e4cf55 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -785,7 +785,7 @@ public:
const char* name() const override { return "AAHairlineOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index 5733cf23b0..5d6b6cf9dd 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -177,7 +177,7 @@ public:
const char* name() const override { return "AAFlatteningConvexPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp
index a6a1f4851d..22cd6ced19 100644
--- a/src/gpu/ops/GrAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrAAStrokeRectOp.cpp
@@ -171,7 +171,7 @@ public:
const char* name() const override { return "AAStrokeRect"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index 051c54120a..0a1a7a1ae9 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -97,7 +97,7 @@ public:
const char* name() const override { return "AtlasTextOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessors.visitProxies(func);
const sk_sp<GrTextureProxy>* proxies = fFontCache->getProxies(this->maskFormat());
diff --git a/src/gpu/ops/GrCopySurfaceOp.h b/src/gpu/ops/GrCopySurfaceOp.h
index 7debfcd6a9..0e93573c36 100644
--- a/src/gpu/ops/GrCopySurfaceOp.h
+++ b/src/gpu/ops/GrCopySurfaceOp.h
@@ -21,7 +21,7 @@ public:
const char* name() const override { return "CopySurface"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
func(fDst.get());
func(fSrc.get());
}
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index 8e2394be64..640e8a9f7b 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -264,7 +264,7 @@ public:
const char* name() const override { return "DashOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessorSet.visitProxies(func);
}
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 7c31f1e4c8..420be4be3f 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -343,7 +343,7 @@ public:
const char* name() const override { return "DefaultPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrDrawAtlasOp.h b/src/gpu/ops/GrDrawAtlasOp.h
index 1dc2386070..8530e5b3dc 100644
--- a/src/gpu/ops/GrDrawAtlasOp.h
+++ b/src/gpu/ops/GrDrawAtlasOp.h
@@ -33,7 +33,7 @@ public:
const char* name() const override { return "DrawAtlasOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h
index 98c3807e46..114ce96a64 100644
--- a/src/gpu/ops/GrDrawPathOp.h
+++ b/src/gpu/ops/GrDrawPathOp.h
@@ -36,7 +36,7 @@ protected:
: RequiresDstTexture::kNo;
}
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessorSet.visitProxies(func);
}
diff --git a/src/gpu/ops/GrDrawVerticesOp.h b/src/gpu/ops/GrDrawVerticesOp.h
index c2a5b45238..6e78008138 100644
--- a/src/gpu/ops/GrDrawVerticesOp.h
+++ b/src/gpu/ops/GrDrawVerticesOp.h
@@ -46,7 +46,7 @@ public:
const char* name() const override { return "DrawVerticesOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index 64983f4e66..35d1ab7fcb 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -60,7 +60,7 @@ public:
const char* name() const override { return "NonAALatticeOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index bd9f14ceb9..3fb1acdfa2 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -244,7 +244,7 @@ public:
const char* name() const override { return "MSAAPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp
index 8b58fe5f43..02a5e84378 100644
--- a/src/gpu/ops/GrNonAAFillRectOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectOp.cpp
@@ -139,7 +139,7 @@ public:
const char* name() const override { return "NonAAFillRectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
@@ -262,7 +262,7 @@ public:
const char* name() const override { return "NonAAFillRectPerspectiveOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
index de2f46e527..1dd1733e07 100644
--- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
@@ -63,7 +63,7 @@ public:
const char* name() const override { return "NonAAStrokeRectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h
index 70928b4d71..ece868fd44 100644
--- a/src/gpu/ops/GrOp.h
+++ b/src/gpu/ops/GrOp.h
@@ -67,7 +67,7 @@ public:
typedef std::function<void(GrSurfaceProxy*)> VisitProxyFunc;
- virtual void visitProxies(VisitProxyFunc) const {
+ virtual void visitProxies(const VisitProxyFunc&) const {
// This default implementation assumes the op has no proxies
}
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 755acced77..243e38b79a 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -785,7 +785,7 @@ public:
const char* name() const override { return "CircleOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
@@ -1252,7 +1252,7 @@ public:
const char* name() const override { return "EllipseOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
@@ -1482,7 +1482,7 @@ public:
const char* name() const override { return "DIEllipseOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
@@ -1800,7 +1800,7 @@ public:
const char* name() const override { return "CircularRRectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
@@ -2157,7 +2157,7 @@ public:
const char* name() const override { return "EllipticalRRectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp
index 054bb81ae7..23a5020f6b 100644
--- a/src/gpu/ops/GrRegionOp.cpp
+++ b/src/gpu/ops/GrRegionOp.cpp
@@ -79,7 +79,7 @@ public:
const char* name() const override { return "GrRegionOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
index cf8763f1d7..47a81827c6 100644
--- a/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
+++ b/src/gpu/ops/GrSimpleMeshDrawOpHelper.h
@@ -97,7 +97,7 @@ public:
friend class GrSimpleMeshDrawOpHelper;
};
- void visitProxies(std::function<void(GrSurfaceProxy*)> func) const {
+ void visitProxies(const std::function<void(GrSurfaceProxy*)>& func) const {
if (fProcessors) {
fProcessors->visitProxies(func);
}
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 8be6922078..6a037a6540 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -192,7 +192,7 @@ public:
const char* name() const override { return "SmallPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
const sk_sp<GrTextureProxy>* proxies = fAtlas->getProxies();
diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp
index 9acaffa67f..730e91be1f 100644
--- a/src/gpu/ops/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp
@@ -177,7 +177,7 @@ public:
const char* name() const override { return "TessellatingPathOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 92278d139d..1149ed26e5 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -245,7 +245,7 @@ public:
const char* name() const override { return "TextureOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
auto proxies = this->proxies();
for (int i = 0; i < fProxyCnt; ++i) {
func(proxies[i]);
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index a8fdc7cc58..51c1985ee1 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -58,7 +58,7 @@ public:
const char* name() const override { return "NonAARectOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fHelper.visitProxies(func);
}
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index f115bbb0ac..9655193e84 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -31,7 +31,7 @@ public:
const char* name() const override { return "TestOp"; }
- void visitProxies(VisitProxyFunc func) const override {
+ void visitProxies(const VisitProxyFunc& func) const override {
fProcessors.visitProxies(func);
}