aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkModeColorFilter.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-10-26 15:32:26 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-26 20:58:56 +0000
commite902f8dc7e111ede8b22cbd9bb74f326b0ce36fb (patch)
tree95dc624b84d6d74cbf0f2081e5ceac97b02afdc4 /src/core/SkModeColorFilter.cpp
parent1285f413950910782d5439b5072ccfa14bdf80f7 (diff)
SkRasterPipelineBlitter simplifications
The main idea here is to simplify, mainly to reduce the number of SkRasterPipeline objects the blitter holds. - Use SkBlendMode instead of SkXfermode, just store SkBlendMode. - Fuse the shader and color filter together into one SkRasterPipeline during blitter creation. - I noticed all calls to append_load_d() and append_store() now have the same ctx argument, so I folded that through. I'll be following up with more of this sort of refactoring... I think I can fold everything into a single SkRasterPipeline during blitter creation now, but I'll want to make sure I've got my ducks in a row for how that works with pipeline strength reduction (like skipping dst loads when drawing in Src mode). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4021 Change-Id: I88252ab8ad16f102c71bad871f8b6aec2fc1f226 Reviewed-on: https://skia-review.googlesource.com/4021 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkModeColorFilter.cpp')
-rw-r--r--src/core/SkModeColorFilter.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/core/SkModeColorFilter.cpp b/src/core/SkModeColorFilter.cpp
index 977e87f7e5..98cb3b2ae6 100644
--- a/src/core/SkModeColorFilter.cpp
+++ b/src/core/SkModeColorFilter.cpp
@@ -6,6 +6,7 @@
*/
#include "SkBlitRow.h"
+#include "SkBlendModePriv.h"
#include "SkColorFilter.h"
#include "SkColorPriv.h"
#include "SkModeColorFilter.h"
@@ -89,13 +90,7 @@ bool SkModeColorFilter::onAppendStages(SkRasterPipeline* p) const {
// and applying the opposite xfermode, e.g. dst-in instead of src-in.
p->append(SkRasterPipeline::swap_src_dst);
p->append(SkRasterPipeline::constant_color, &fPM4f);
-
- // TODO: This is ugly. I think we want static SkXfermode::AppendStages(Mode).
- if (auto xfermode = SkXfermode::Make(fMode)) {
- return xfermode->appendStages(p);
- }
- p->append(SkRasterPipeline::srcover);
- return true;
+ return SkBlendMode_AppendStages((SkBlendMode)fMode, p);
}
///////////////////////////////////////////////////////////////////////////////