aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-01-12 12:06:06 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-12 19:31:03 +0000
commit7cdabedc8b73b70e4aa70c5621a4bdc8e00ede44 (patch)
tree3068170ce9076b048fc322546be948a6f2eb9381 /src/gpu/effects
parent1001f843a45e95f6df1d44242b6b06c77898e870 (diff)
Use GrOvalOpFactory ops to draw non-AA rrects, ovals, and arcs.
This improves performance. Bug: skia: Change-Id: Ie01170ec084be66ea166b2baffcdb415583aa523 Reviewed-on: https://skia-review.googlesource.com/93321 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrCustomXfermode.cpp7
-rw-r--r--src/gpu/effects/GrPorterDuffXferProcessor.cpp5
-rw-r--r--src/gpu/effects/GrPorterDuffXferProcessor.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index bdeda9467c..b43cea9a69 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -225,6 +225,8 @@ private:
const GrCaps&,
GrPixelConfigIsClamped) const override;
+ bool asBlendMode(SkBlendMode* mode) const override;
+
GR_DECLARE_XP_FACTORY_TEST
SkBlendMode fMode;
@@ -362,6 +364,11 @@ GrXPFactory::AnalysisProperties CustomXPFactory::analysisProperties(
AnalysisProperties::kReadsDstInShader;
}
+bool CustomXPFactory::asBlendMode(SkBlendMode* mode) const {
+ *mode = fMode;
+ return true;
+}
+
GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory);
#if GR_TEST_UTILS
const GrXPFactory* CustomXPFactory::TestGet(GrProcessorTestData* d) {
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index f4af7a4679..c8f11e0f5d 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -861,6 +861,11 @@ GrXPFactory::AnalysisProperties GrPorterDuffXPFactory::analysisProperties(
return analysis_properties(color, coverage, caps, dstIsClamped, fBlendMode);
}
+bool GrPorterDuffXPFactory::asBlendMode(SkBlendMode* mode) const {
+ *mode = fBlendMode;
+ return true;
+}
+
GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.h b/src/gpu/effects/GrPorterDuffXferProcessor.h
index 74ae1533bf..8241a9f1ab 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.h
@@ -58,6 +58,8 @@ private:
const GrCaps&,
GrPixelConfigIsClamped) const override;
+ bool asBlendMode(SkBlendMode* mode) const override;
+
GR_DECLARE_XP_FACTORY_TEST
static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, int* outSecondary);