aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessorSet.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-03 14:00:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-03 20:50:40 +0000
commitff574e0eb79b83c2e797dec8f1661378876202d8 (patch)
treefe12d664ddbc0c7e84d284e11e9d25ac66230d37 /src/gpu/GrProcessorSet.cpp
parentbc4c96bc65ab6ee0acc62d5d8a6613156991ac6c (diff)
Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp.
This uses a new helper class, GrSimpleMeshDrawOpHelper, which it uses to fullfill the GrMeshDrawOp contract and to construct its GrPipline when flushed. The helper is intended to be used such that the op only stores a GrProcessorSet if it is constructed with a "nontrivial" GrPaint. "Trivial" currently means no fragment processors and src-over blending. The helper allows the op subclass to specify whether it supports stenciling via a template parameter. The helper class is initially intended to be used for ops that don't have per-vertex colors and construct a single GrPipeline at flush time, though perhaps this can be relaxed in future changes. On the microbenchmark "rotated_rects_bw_same_transparent_srcover" this produces a 18-20% reduction in time on my Z840 running Linux and 33% on my 2010 MacPro. Bug: skia: Change-Id: I9f655827a70bee585b0b0e1255371ffd995a0b80 Reviewed-on: https://skia-review.googlesource.com/14604 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrProcessorSet.cpp')
-rw-r--r--src/gpu/GrProcessorSet.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
index 69fa69a324..db732666b7 100644
--- a/src/gpu/GrProcessorSet.cpp
+++ b/src/gpu/GrProcessorSet.cpp
@@ -11,6 +11,8 @@
#include "GrXferProcessor.h"
#include "effects/GrPorterDuffXferProcessor.h"
+const GrProcessorSet GrProcessorSet::gEmpty{GrProcessorSet::Empty::kEmpty};
+
GrProcessorSet::GrProcessorSet(GrPaint&& paint) : fXP(paint.getXPFactory()) {
fFlags = 0;
if (paint.numColorFragmentProcessors() <= kMaxColorProcessors) {