diff options
author | Brian Salomon <bsalomon@google.com> | 2017-01-09 11:46:10 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-09 17:21:03 +0000 |
commit | a16339297859f37df69230e64f05624cef511ad3 (patch) | |
tree | 07dbb20733defb86e05bc8cc924b4ced8ca78374 /include/gpu/effects | |
parent | a7080264d11235d6f469d355b14a7647cba8eb75 (diff) |
Revert "Revert "Removing ref counting from GrXPFactory.""
This reverts commit 003312a211e65f35e402d6fe80a32e23d4c94ac4.
Change-Id: Ib41065e5c356d1dd99e70fa10611ac6756c2b79d
Reviewed-on: https://skia-review.googlesource.com/6803
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/effects')
-rw-r--r-- | include/gpu/effects/GrCoverageSetOpXP.h | 18 | ||||
-rw-r--r-- | include/gpu/effects/GrCustomXfermode.h | 2 | ||||
-rw-r--r-- | include/gpu/effects/GrPorterDuffXferProcessor.h | 19 |
3 files changed, 23 insertions, 16 deletions
diff --git a/include/gpu/effects/GrCoverageSetOpXP.h b/include/gpu/effects/GrCoverageSetOpXP.h index 2aae7be41d..ca71abc4e0 100644 --- a/include/gpu/effects/GrCoverageSetOpXP.h +++ b/include/gpu/effects/GrCoverageSetOpXP.h @@ -14,6 +14,12 @@ class GrProcOptInfo; +// See the comment above GrXPFactory's definition about this warning suppression. +#if defined(__GNUC__) || defined(__clang) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + /** * This xfer processor directly blends the the src coverage with the dst using a set operator. It is * useful for rendering coverage masks using CSG. It can optionally invert the src coverage before @@ -21,13 +27,13 @@ class GrProcOptInfo; */ class GrCoverageSetOpXPFactory : public GrXPFactory { public: - static sk_sp<GrXPFactory> Make(SkRegion::Op regionOp, bool invertCoverage = false); + static const GrXPFactory* Get(SkRegion::Op regionOp, bool invertCoverage = false); void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, GrXPFactory::InvariantBlendedColor*) const override; private: - GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); + constexpr GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); GrXferProcessor* onCreateXferProcessor(const GrCaps&, const GrPipelineAnalysis&, @@ -38,11 +44,6 @@ private: return false; } - bool onIsEqual(const GrXPFactory& xpfBase) const override { - const GrCoverageSetOpXPFactory& xpf = xpfBase.cast<GrCoverageSetOpXPFactory>(); - return fRegionOp == xpf.fRegionOp; - } - GR_DECLARE_XP_FACTORY_TEST; SkRegion::Op fRegionOp; @@ -50,5 +51,8 @@ private: typedef GrXPFactory INHERITED; }; +#if defined(__GNUC__) || defined(__clang) +#pragma GCC diagnostic pop +#endif #endif diff --git a/include/gpu/effects/GrCustomXfermode.h b/include/gpu/effects/GrCustomXfermode.h index a8c868e034..54309ddafc 100644 --- a/include/gpu/effects/GrCustomXfermode.h +++ b/include/gpu/effects/GrCustomXfermode.h @@ -20,7 +20,7 @@ class GrXPFactory; */ namespace GrCustomXfermode { bool IsSupportedMode(SkBlendMode mode); - sk_sp<GrXPFactory> MakeXPFactory(SkBlendMode mode); + const GrXPFactory* Get(SkBlendMode mode); }; #endif diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h index 29d56ab29a..ca14275926 100644 --- a/include/gpu/effects/GrPorterDuffXferProcessor.h +++ b/include/gpu/effects/GrPorterDuffXferProcessor.h @@ -14,9 +14,14 @@ class GrProcOptInfo; +// See the comment above GrXPFactory's definition about this warning suppression. +#if defined(__GNUC__) || defined(__clang) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif class GrPorterDuffXPFactory : public GrXPFactory { public: - static sk_sp<GrXPFactory> Make(SkBlendMode mode); + static const GrXPFactory* Get(SkBlendMode blendMode); void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, GrXPFactory::InvariantBlendedColor*) const override; @@ -51,7 +56,7 @@ public: static bool SrcOverWillNeedDstTexture(const GrCaps&, const GrPipelineAnalysis&); private: - GrPorterDuffXPFactory(SkBlendMode); + constexpr GrPorterDuffXPFactory(SkBlendMode); GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, const GrPipelineAnalysis&, @@ -60,18 +65,16 @@ private: bool onWillReadDstColor(const GrCaps&, const GrPipelineAnalysis&) const override; - bool onIsEqual(const GrXPFactory& xpfBase) const override { - const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>(); - return fXfermode == xpf.fXfermode; - } - GR_DECLARE_XP_FACTORY_TEST; static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, int* outSecondary); - SkBlendMode fXfermode; + SkBlendMode fBlendMode; friend class GrPorterDuffTest; // for TestGetXPOutputTypes() typedef GrXPFactory INHERITED; }; +#if defined(__GNUC__) || defined(__clang) +#pragma GCC diagnostic pop +#endif #endif |