aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessorSet.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-03-16 14:19:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-16 19:10:15 +0000
commit2bf4b3a97b770811d9e0558dbbfbdb57cfafbdb7 (patch)
tree3e73ebe67a871db43e4ba9f0a9df3edf15361bca /src/gpu/GrProcessorSet.h
parent1165b1ef6f069d512c6d5a43ef431b3be6f8c80f (diff)
Remove GrPipeline from GrDrawOp.
GrDrawOp subclasses are now free to construct their pipelines at flush time and now in theory could use multiple GrPipelines for multipass rendering. GrProcessorSet may be used to retain the processors from a GrPaint with "pending execution" style refs. NVPR and Instanced rendering are updated to create their pipelines at flush time without a GrPipelineBuilder. The monolithic pipeline creation/management that was on GrDrawOp is moved to GrMeshDrawOp. However, this is temporary and will be removed in coming changes. Change-Id: I124282e3cea5d070970b5460c8a679fcaf7a8eff Reviewed-on: https://skia-review.googlesource.com/7279 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProcessorSet.h')
-rw-r--r--src/gpu/GrProcessorSet.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h
index 8203491435..18a52fd9b7 100644
--- a/src/gpu/GrProcessorSet.h
+++ b/src/gpu/GrProcessorSet.h
@@ -20,13 +20,15 @@ class GrProcessorSet : private SkNoncopyable {
public:
GrProcessorSet(GrPaint&& paint);
- ~GrProcessorSet() {
- // We are deliberately not using sk_sp here because this will be updated to work with
- // "pending execution" refs.
- for (auto fp : fFragmentProcessors) {
- fp->unref();
- }
- }
+ ~GrProcessorSet();
+
+ /**
+ * If an op is recorded with this processor set then this must be called to ensure pending
+ * reads and writes are propagated to resources referred to by the processors. Otherwise,
+ * data hazards may occur.
+ */
+ void makePendingExecution();
+ bool isPendingExecution() const { return SkToBool(kPendingExecution_Flag & fFlags); }
int numColorFragmentProcessors() const { return fColorFragmentProcessorCnt; }
int numCoverageFragmentProcessors() const {
@@ -50,6 +52,9 @@ public:
}
bool allowSRGBInputs() const { return SkToBool(fFlags & kAllowSRGBInputs_Flag); }
+ bool operator==(const GrProcessorSet& that) const;
+ bool operator!=(const GrProcessorSet& that) const { return !(*this == that); }
+
/**
* This is used to track analysis of color and coverage values through the fragment processors.
*/
@@ -156,7 +161,8 @@ private:
enum Flags : uint16_t {
kUseDistanceVectorField_Flag = 0x1,
kDisableOutputConversionToSRGB_Flag = 0x2,
- kAllowSRGBInputs_Flag = 0x4
+ kAllowSRGBInputs_Flag = 0x4,
+ kPendingExecution_Flag = 0x8
};
const GrXPFactory* fXPFactory = nullptr;