aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathRendererChain.h
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2017-02-22 12:00:42 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-22 20:29:56 +0000
commit008b9d80ab9adbf2656eceaf54d11cd15e4dda05 (patch)
tree06d4863dc3f65dcdb6704ec65f31800e544ea181 /src/gpu/GrPathRendererChain.h
parent19eec39c90a357ff3476d65f2c672096f55518e3 (diff)
Add the ability to enable/disable GPU path renderers
Adds a bitfield to GrContextOptions that masks out path renderers. Adds commandline flags support to set this bitfield in tools apps. Removes GrGLInterfaceRemoveNVPR since we can now accomplish the same thing in the context options. BUG=skia: Change-Id: Icf2a4df36374b3ba2f69ebf0db56e8aedd6cf65f Reviewed-on: https://skia-review.googlesource.com/8786 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrPathRendererChain.h')
-rw-r--r--src/gpu/GrPathRendererChain.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gpu/GrPathRendererChain.h b/src/gpu/GrPathRendererChain.h
index 9a1a8fe108..c0a0ee39f5 100644
--- a/src/gpu/GrPathRendererChain.h
+++ b/src/gpu/GrPathRendererChain.h
@@ -10,6 +10,7 @@
#include "GrPathRenderer.h"
+#include "GrContextOptions.h"
#include "SkTypes.h"
#include "SkTArray.h"
@@ -24,14 +25,12 @@ class GrContext;
class GrPathRendererChain : public SkNoncopyable {
public:
struct Options {
- bool fDisableDistanceFieldRenderer = false;
+ using GpuPathRenderers = GrContextOptions::GpuPathRenderers;
bool fAllowPathMaskCaching = false;
- bool fDisableAllPathRenderers = false;
+ GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
};
GrPathRendererChain(GrContext* context, const Options&);
- ~GrPathRendererChain();
-
/** Documents how the caller plans to use a GrPathRenderer to draw a path. It affects the PR
returned by getPathRenderer */
enum class DrawType {
@@ -49,13 +48,10 @@ public:
GrPathRenderer::StencilSupport* stencilSupport);
private:
- // takes a ref and unrefs in destructor
- GrPathRenderer* addPathRenderer(GrPathRenderer* pr);
-
enum {
kPreAllocCount = 8,
};
- SkSTArray<kPreAllocCount, GrPathRenderer*, true> fChain;
+ SkSTArray<kPreAllocCount, sk_sp<GrPathRenderer>> fChain;
};
#endif