aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-11-20 15:12:59 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-20 15:12:59 -0800
commitf234272cbdcbcd46be462317e75cd138999c9fe9 (patch)
treefa3de6c2762df48a7e05c1fdd1244df802ad953b /include
parent1c9ce610501b7b864617356aeda12cd0caebe066 (diff)
Revert of Make specialized SrcOver XPFactory (patchset #3 id:40001 of https://codereview.chromium.org/1455273006/ )
Reason for revert: breaking some builds Original issue's description: > Make specialized SrcOver XPFactory > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/a7006d45217d128a94fa53cb4b827cca79bc7049 TBR=bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1464933003
Diffstat (limited to 'include')
-rw-r--r--include/core/SkXfermode.h4
-rw-r--r--include/gpu/effects/GrCustomXfermode.h2
-rw-r--r--include/gpu/effects/GrPorterDuffXferProcessor.h51
3 files changed, 7 insertions, 50 deletions
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 4337d20b61..cb9557f92c 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -209,13 +209,13 @@ public:
will install it and own a ref to it. Since the xfermode may or may not assign *xpf, the
caller should set *xpf to NULL beforehand. XferProcessors cannot use a background texture.
*/
- virtual bool asXPFactory(const GrXPFactory** xpf) const;
+ virtual bool asXPFactory(GrXPFactory** xpf) const;
/** Returns true if the xfermode can be expressed as an xfer processor factory (xpFactory).
This helper calls the asXPFactory() virtual. If the xfermode is NULL, it is treated as
kSrcOver_Mode. It is legal to call this with xpf param NULL to simply test the return value.
*/
- static bool AsXPFactory(SkXfermode*, const GrXPFactory**);
+ static bool AsXPFactory(SkXfermode*, GrXPFactory**);
SK_TO_STRING_PUREVIRT()
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
diff --git a/include/gpu/effects/GrCustomXfermode.h b/include/gpu/effects/GrCustomXfermode.h
index 7fe930822a..bcbd5833ca 100644
--- a/include/gpu/effects/GrCustomXfermode.h
+++ b/include/gpu/effects/GrCustomXfermode.h
@@ -18,7 +18,7 @@ class GrTexture;
*/
namespace GrCustomXfermode {
bool IsSupportedMode(SkXfermode::Mode mode);
- const GrXPFactory* CreateXPFactory(SkXfermode::Mode mode);
+ GrXPFactory* CreateXPFactory(SkXfermode::Mode mode);
};
#endif
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 72faeb572c..d297e32908 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -14,9 +14,9 @@
class GrProcOptInfo;
-class GrPDXPFactory : public GrXPFactory {
+class GrPorterDuffXPFactory : public GrXPFactory {
public:
- static const GrXPFactory* Create(SkXfermode::Mode mode);
+ static GrXPFactory* Create(SkXfermode::Mode mode);
bool supportsRGBCoverage(GrColor /*knownColor*/, uint32_t /*knownColorFlags*/) const override {
return true;
@@ -26,7 +26,7 @@ public:
GrXPFactory::InvariantBlendedColor*) const override;
private:
- GrPDXPFactory(SkXfermode::Mode);
+ GrPorterDuffXPFactory(SkXfermode::Mode);
GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
@@ -40,7 +40,7 @@ private:
bool hasMixedSamples) const override;
bool onIsEqual(const GrXPFactory& xpfBase) const override {
- const GrPDXPFactory& xpf = xpfBase.cast<GrPDXPFactory>();
+ const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>();
return fXfermode == xpf.fXfermode;
}
@@ -53,47 +53,4 @@ private:
typedef GrXPFactory INHERITED;
};
-class GrSrcOverPDXPFactory : public GrXPFactory {
-public:
- GrSrcOverPDXPFactory();
-
- bool supportsRGBCoverage(GrColor /*knownColor*/, uint32_t /*knownColorFlags*/) const override {
- return true;
- }
-
- void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
- GrXPFactory::InvariantBlendedColor*) const override;
-
-private:
- GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
- bool hasMixedSamples,
- const DstTexture*) const override;
-
- bool willReadDstColor(const GrCaps& caps,
- const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
- bool hasMixedSamples) const override;
-
- bool onIsEqual(const GrXPFactory& /*xpfBase*/) const override {
- return true;
- }
-
- GR_DECLARE_XP_FACTORY_TEST;
-
- typedef GrXPFactory INHERITED;
-};
-
-namespace GrPorterDuffXPFactory {
- const GrSrcOverPDXPFactory gSrcOverPDXPFactory;
-
- inline const GrXPFactory* Create(SkXfermode::Mode mode) {
- if (SkXfermode::kSrcOver_Mode == mode) {
- return SkRef(&gSrcOverPDXPFactory);
- }
- return GrPDXPFactory::Create(mode);
- }
-};
-
#endif