From e5b399ee69332e0d68a660d6695d1182a4cb16b1 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 19 Jul 2017 13:50:54 -0400 Subject: Remove GrLegacyMeshDrawOp and GrPipelineBuilder Change-Id: Ib301a0e7d4b4c4f05417d28862017307949748c9 Reviewed-on: https://skia-review.googlesource.com/23584 Commit-Queue: Brian Salomon Reviewed-by: Greg Daniel --- src/gpu/GrDrawOpTest.h | 1 - src/gpu/GrPathRenderer.h | 15 +-- src/gpu/GrPipeline.cpp | 4 +- src/gpu/GrPipeline.h | 6 +- src/gpu/GrPipelineBuilder.h | 119 -------------------- src/gpu/GrRenderTargetContext.cpp | 64 ----------- src/gpu/GrRenderTargetContext.h | 4 - src/gpu/GrRenderTargetContextPriv.h | 5 - src/gpu/GrRenderTargetOpList.h | 1 - src/gpu/GrSWMaskHelper.cpp | 1 - src/gpu/GrSoftwarePathRenderer.cpp | 1 - src/gpu/ops/GrAAConvexPathRenderer.cpp | 1 - src/gpu/ops/GrAAHairLinePathRenderer.cpp | 1 - src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp | 1 - src/gpu/ops/GrAtlasTextOp.cpp | 2 +- src/gpu/ops/GrAtlasTextOp.h | 6 +- src/gpu/ops/GrDashLinePathRenderer.cpp | 1 - src/gpu/ops/GrDefaultPathRenderer.cpp | 1 - src/gpu/ops/GrMSAAPathRenderer.cpp | 1 - src/gpu/ops/GrMeshDrawOp.cpp | 4 +- src/gpu/ops/GrMeshDrawOp.h | 129 ---------------------- src/gpu/ops/GrOvalOpFactory.h | 1 - src/gpu/ops/GrSmallPathRenderer.cpp | 7 +- src/gpu/ops/GrStencilAndCoverPathRenderer.cpp | 1 - src/gpu/ops/GrTessellatingPathRenderer.cpp | 5 +- src/gpu/text/GrAtlasTextBlob.cpp | 1 - src/gpu/text/GrAtlasTextBlob.h | 1 - src/gpu/text/GrAtlasTextContext.h | 1 - src/gpu/text/GrStencilAndCoverTextContext.cpp | 1 - 29 files changed, 20 insertions(+), 366 deletions(-) delete mode 100644 src/gpu/GrPipelineBuilder.h (limited to 'src/gpu') diff --git a/src/gpu/GrDrawOpTest.h b/src/gpu/GrDrawOpTest.h index 57d5afb1c7..6dc9541d77 100644 --- a/src/gpu/GrDrawOpTest.h +++ b/src/gpu/GrDrawOpTest.h @@ -14,7 +14,6 @@ #if GR_TEST_UTILS class GrDrawOp; -class GrLegacyMeshDrawOp; class GrPaint; class GrRenderTargetContext; struct GrUserStencilSettings; diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index c55ed57b45..a3cf8c6151 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -23,10 +23,6 @@ struct GrPoint; /** * Base class for drawing paths into a GrOpList. - * - * Derived classes can use stages GrPaint::kTotalStages through GrPipelineBuilder::kNumStages-1. - * The stages before GrPaint::kTotalStages are reserved for setting up the draw (i.e., textures and - * filter masks). */ class SK_API GrPathRenderer : public SkRefCnt { public: @@ -40,11 +36,10 @@ public: * rendered into the stencil. * * A GrPathRenderer can provide three levels of support for stenciling paths: - * 1) kNoRestriction: This is the most general. The caller sets up the GrPipelineBuilder on the - * target and calls drawPath(). The path is rendered exactly as the draw - * state indicates including support for simultaneous color and stenciling - * with arbitrary stenciling rules. Pixels partially covered by AA paths are - * affected by the stencil settings. + * 1) kNoRestriction: This is the most general. The caller passes a GrPaint and calls drawPath(). + * The path is rendered exactly as the draw state indicates including support + * for simultaneous color and stenciling with arbitrary stenciling rules. + * Pixels partially covered by AA paths are affected by the stencil settings. * 2) kStencilOnly: The path renderer cannot apply arbitrary stencil rules nor shade and stencil * simultaneously. The path renderer does support the stencilPath() function * which performs no color writes and writes a non-zero stencil value to pixels @@ -147,7 +142,7 @@ public: /** * Draws the path into the draw target. If getStencilSupport() would return kNoRestriction then - * the subclass must respect the stencil settings of the GrPipelineBuilder. + * the subclass must respect the stencil settings. */ bool drawPath(const DrawPathArgs& args) { SkDEBUGCODE(args.validate();) diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp index e54369e5ef..0483d4289c 100644 --- a/src/gpu/GrPipeline.cpp +++ b/src/gpu/GrPipeline.cpp @@ -10,7 +10,6 @@ #include "GrAppliedClip.h" #include "GrCaps.h" #include "GrGpu.h" -#include "GrPipelineBuilder.h" #include "GrRenderTargetContext.h" #include "GrRenderTargetOpList.h" #include "GrRenderTargetPriv.h" @@ -50,8 +49,7 @@ void GrPipeline::init(const InitArgs& args) { fDstTextureOffset = args.fDstProxy.offset(); } - // Copy GrFragmentProcessors from GrPipelineBuilder to Pipeline, possibly removing some of the - // color fragment processors. + // Copy GrFragmentProcessors from GrProcessorSet to Pipeline fNumColorProcessors = args.fProcessors->numColorFragmentProcessors(); int numTotalProcessors = fNumColorProcessors + args.fProcessors->numCoverageFragmentProcessors(); diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h index 5d6041c5ef..81b7923068 100644 --- a/src/gpu/GrPipeline.h +++ b/src/gpu/GrPipeline.h @@ -29,12 +29,12 @@ class GrAppliedClip; class GrDeviceCoordTexture; class GrOp; -class GrPipelineBuilder; class GrRenderTargetContext; /** - * Class that holds an optimized version of a GrPipelineBuilder. It is meant to be an immutable - * class, and contains all data needed to set the state for a gpu draw. + * This immutable object contains information needed to set build a shader program and set API + * state for a draw. It is used along with a GrPrimitiveProcessor and a source of geometric + * data (GrMesh or GrPath) to draw. */ class GrPipeline : public GrNonAtomicRef { public: diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h deleted file mode 100644 index 9023e8ae1d..0000000000 --- a/src/gpu/GrPipelineBuilder.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrPipelineBuilder_DEFINED -#define GrPipelineBuilder_DEFINED - -#include "GrPipeline.h" -#include "GrProcessorSet.h" -#include "GrUserStencilSettings.h" -#include "GrXferProcessor.h" - -class GrCaps; -class GrDrawOp; -class GrPaint; -class GrTexture; - -class GrPipelineBuilder : private SkNoncopyable { -public: - /** - * Initializes the GrPipelineBuilder based on a GrPaint and MSAA availability. Note - * that GrPipelineBuilder encompasses more than GrPaint. Aspects of GrPipelineBuilder that have - * no GrPaint equivalents are set to default values with the exception of vertex attribute state - * which is unmodified by this function and clipping which will be enabled. - */ - GrPipelineBuilder(GrPaint&& paint, GrAAType aaType) - : fFlags(GrPipeline::SRGBFlagsFromPaint(paint)) - , fUserStencilSettings(&GrUserStencilSettings::kUnused) - , fProcessors(std::move(paint)) { - if (GrAATypeIsHW(aaType)) { - fFlags |= GrPipeline::kHWAntialias_Flag; - } - } - - /////////////////////////////////////////////////////////////////////////// - /// @name Fragment Processors - /// - /// GrFragmentProcessors are used to compute per-pixel color and per-pixel fractional coverage. - /// There are two chains of FPs, one for color and one for coverage. The first FP in each - /// chain gets the initial color/coverage from the GrPrimitiveProcessor. It computes an output - /// color/coverage which is fed to the next FP in the chain. The last color and coverage FPs - /// feed their output to the GrXferProcessor which controls blending. - //// - - int numColorFragmentProcessors() const { return fProcessors.numColorFragmentProcessors(); } - int numCoverageFragmentProcessors() const { - return fProcessors.numCoverageFragmentProcessors(); - } - int numFragmentProcessors() const { return fProcessors.numFragmentProcessors(); } - - const GrFragmentProcessor* getColorFragmentProcessor(int idx) const { - return fProcessors.colorFragmentProcessor(idx); - } - const GrFragmentProcessor* getCoverageFragmentProcessor(int idx) const { - return fProcessors.coverageFragmentProcessor(idx); - } - - const GrProcessorSet& processors() const { return fProcessors; } - - GrProcessorSet::Analysis finalizeProcessors(const GrProcessorAnalysisColor& colorInput, - const GrProcessorAnalysisCoverage coverageInput, - const GrAppliedClip* clip, bool isMixedSamples, - const GrCaps& caps, GrColor* overrideColor) { - return fProcessors.finalize(colorInput, coverageInput, clip, isMixedSamples, caps, - overrideColor); - } - - /// @} - - - /////////////////////////////////////////////////////////////////////////// - /// @name Stencil - //// - - bool hasUserStencilSettings() const { return !fUserStencilSettings->isUnused(); } - - /** - * Sets the user stencil settings for the next draw. - * This class only stores pointers to stencil settings objects. - * The caller guarantees the pointer will remain valid until it - * changes or goes out of scope. - * @param settings the stencil settings to use. - */ - void setUserStencil(const GrUserStencilSettings* settings) { fUserStencilSettings = settings; } - - /// @} - - /////////////////////////////////////////////////////////////////////////// - /// @name State Flags - //// - - bool isHWAntialias() const { return SkToBool(fFlags & GrPipeline::kHWAntialias_Flag); } - - void setSnapVerticesToPixelCenters(bool enable) { - if (enable) { - fFlags |= GrPipeline::kSnapVerticesToPixelCenters_Flag; - } else { - fFlags &= ~GrPipeline::kSnapVerticesToPixelCenters_Flag; - } - } - - /// @} - - void getPipelineInitArgs(GrPipeline::InitArgs* args) const { - args->fFlags = fFlags; - args->fUserStencil = fUserStencilSettings; - args->fProcessors = &fProcessors; - } - -private: - uint32_t fFlags; - const GrUserStencilSettings* fUserStencilSettings; - GrProcessorSet fProcessors; -}; - -#endif diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index 6a08447196..65f19e3c5c 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -16,7 +16,6 @@ #include "GrFixedClip.h" #include "GrGpuResourcePriv.h" #include "GrPathRenderer.h" -#include "GrPipelineBuilder.h" #include "GrRenderTarget.h" #include "GrRenderTargetContextPriv.h" #include "GrResourceProvider.h" @@ -1799,69 +1798,6 @@ uint32_t GrRenderTargetContext::addDrawOp(const GrClip& clip, std::unique_ptr op) { - ASSERT_SINGLE_OWNER - if (this->drawingManager()->wasAbandoned()) { - return SK_InvalidUniqueID; - } - SkDEBUGCODE(this->validate();) - GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "addLegacyMeshDrawOp", fContext); - - // Setup clip - SkRect bounds; - op_bounds(&bounds, op.get()); - GrAppliedClip appliedClip; - if (!clip.apply(fContext, this, pipelineBuilder.isHWAntialias(), - pipelineBuilder.hasUserStencilSettings(), &appliedClip, &bounds)) { - return SK_InvalidUniqueID; - } - - // This forces instantiation of the render target. Pipeline creation is moving to flush time - // by which point instantiation must have occurred anyway. - GrRenderTarget* rt = this->accessRenderTarget(); - if (!rt) { - return SK_InvalidUniqueID; - } - - GrResourceProvider* resourceProvider = fContext->resourceProvider(); - bool usesStencil = pipelineBuilder.hasUserStencilSettings() || appliedClip.hasStencilClip(); - if (usesStencil) { - if (!resourceProvider->attachStencilAttachment(this->accessRenderTarget())) { - SkDebugf("ERROR creating stencil attachment. Draw skipped.\n"); - return SK_InvalidUniqueID; - } - } - - bool isMixedSamples = GrFSAAType::kMixedSamples == this->fsaaType() && - (pipelineBuilder.isHWAntialias() || usesStencil); - - GrColor overrideColor; - GrProcessorSet::Analysis analysis = op->analyzeUpdateAndRecordProcessors( - &pipelineBuilder, &appliedClip, isMixedSamples, *this->caps(), &overrideColor); - - GrPipeline::InitArgs args; - pipelineBuilder.getPipelineInitArgs(&args); - args.fAppliedClip = &appliedClip; - args.fRenderTarget = rt; - args.fCaps = this->caps(); - args.fResourceProvider = resourceProvider; - - if (analysis.requiresDstTexture()) { - if (!this->setupDstProxy(this->asRenderTargetProxy(), clip, bounds, &args.fDstProxy)) { - return SK_InvalidUniqueID; - } - } - op->initPipeline(args, analysis, overrideColor); - - // Add the pipeline dependencies on textures, etc before recording this op. - op->addDependenciesTo(this->getOpList(), *this->caps()); - - op->setClippedBounds(bounds); - return this->getRTOpList()->addOp(std::move(op), *this->caps()); -} - bool GrRenderTargetContext::setupDstProxy(GrRenderTargetProxy* rtProxy, const GrClip& clip, const SkRect& opBounds, GrXferProcessor::DstProxy* dstProxy) { diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h index 21f90185cf..1958ed7c8e 100644 --- a/src/gpu/GrRenderTargetContext.h +++ b/src/gpu/GrRenderTargetContext.h @@ -26,8 +26,6 @@ class GrCoverageCountingPathRenderer; class GrDrawingManager; class GrDrawOp; class GrFixedClip; -class GrLegacyMeshDrawOp; -class GrPipelineBuilder; class GrRenderTarget; class GrRenderTargetContextPriv; class GrRenderTargetOpList; @@ -414,8 +412,6 @@ private: // the op list. They return the id of the opList to which the op was added, or 0, if it was // dropped (e.g., due to clipping). uint32_t addDrawOp(const GrClip&, std::unique_ptr); - uint32_t addLegacyMeshDrawOp(GrPipelineBuilder&&, const GrClip&, - std::unique_ptr); // Makes a copy of the proxy if it is necessary for the draw and places the texture that should // be used by GrXferProcessor to access the destination color in 'result'. If the return diff --git a/src/gpu/GrRenderTargetContextPriv.h b/src/gpu/GrRenderTargetContextPriv.h index ed1b40bf96..b32eaed189 100644 --- a/src/gpu/GrRenderTargetContextPriv.h +++ b/src/gpu/GrRenderTargetContextPriv.h @@ -102,11 +102,6 @@ public: return fRenderTargetContext->fRenderTargetProxy->uniqueID(); } - uint32_t testingOnly_addLegacyMeshDrawOp(GrPaint&&, GrAAType, - std::unique_ptr, - const GrUserStencilSettings* = nullptr, - bool snapToCenters = false); - uint32_t testingOnly_addDrawOp(std::unique_ptr); bool refsWrappedObjects() const { diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h index 7a26a0500a..68c4890f1c 100644 --- a/src/gpu/GrRenderTargetOpList.h +++ b/src/gpu/GrRenderTargetOpList.h @@ -25,7 +25,6 @@ class GrAuditTrail; class GrClearOp; class GrCaps; -class GrPipelineBuilder; class GrRenderTargetProxy; namespace gr_instanced { diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index 880991327f..5d247fa2b7 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -9,7 +9,6 @@ #include "GrCaps.h" #include "GrContext.h" #include "GrContextPriv.h" -#include "GrPipelineBuilder.h" #include "GrRenderTargetContext.h" #include "GrShape.h" #include "GrSurfaceContext.h" diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index c98f1daef9..e171b78b4a 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -9,7 +9,6 @@ #include "GrAuditTrail.h" #include "GrClip.h" #include "GrGpuResourcePriv.h" -#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrSWMaskHelper.h" #include "ops/GrDrawOp.h" diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index af10450ecc..9841f707ff 100644 --- a/src/gpu/ops/GrAAConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp @@ -15,7 +15,6 @@ #include "GrGeometryProcessor.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrProcessor.h" #include "GrSimpleMeshDrawOpHelper.h" #include "SkGeometry.h" diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 883bc45bbd..5d12fdfdbf 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -14,7 +14,6 @@ #include "GrDrawOpTest.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrProcessor.h" #include "GrResourceProvider.h" #include "GrSimpleMeshDrawOpHelper.h" diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index 9a5f5b04dd..356c7ac4aa 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrGeometryProcessor.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrProcessor.h" #include "GrStyle.h" #include "SkGeometry.h" diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp index a7b4967143..8c49e6dd19 100644 --- a/src/gpu/ops/GrAtlasTextOp.cpp +++ b/src/gpu/ops/GrAtlasTextOp.cpp @@ -144,7 +144,7 @@ void GrAtlasTextOp::onPrepareDraws(Target* target) const { this->flush(target, &flushInfo); } -void GrAtlasTextOp::flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const { +void GrAtlasTextOp::flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const { GrMesh mesh(GrPrimitiveType::kTriangles); int maxGlyphsPerDraw = static_cast(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6); diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h index 449f1fa0ab..3456fe0dcc 100644 --- a/src/gpu/ops/GrAtlasTextOp.h +++ b/src/gpu/ops/GrAtlasTextOp.h @@ -150,7 +150,7 @@ private: kLCDBGRDistanceField_MaskType == fMaskType; } - inline void flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const; + inline void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const; GrColor color() const { return fColor; } const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; } @@ -203,7 +203,7 @@ private: */ class GrBlobRegenHelper { public: - GrBlobRegenHelper(const GrAtlasTextOp* op, GrLegacyMeshDrawOp::Target* target, + GrBlobRegenHelper(const GrAtlasTextOp* op, GrMeshDrawOp::Target* target, GrAtlasTextOp::FlushInfo* flushInfo) : fOp(op), fTarget(target), fFlushInfo(flushInfo) {} @@ -213,7 +213,7 @@ public: private: const GrAtlasTextOp* fOp; - GrLegacyMeshDrawOp::Target* fTarget; + GrMeshDrawOp::Target* fTarget; GrAtlasTextOp::FlushInfo* fFlushInfo; }; diff --git a/src/gpu/ops/GrDashLinePathRenderer.cpp b/src/gpu/ops/GrDashLinePathRenderer.cpp index a364d9294d..38d486c79f 100644 --- a/src/gpu/ops/GrDashLinePathRenderer.cpp +++ b/src/gpu/ops/GrDashLinePathRenderer.cpp @@ -9,7 +9,6 @@ #include "GrAuditTrail.h" #include "GrGpu.h" -#include "GrPipelineBuilder.h" #include "ops/GrDashOp.h" #include "ops/GrMeshDrawOp.h" diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index 565cd78295..891c5a5a1e 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrMesh.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrSimpleMeshDrawOpHelper.h" #include "SkGeometry.h" #include "SkString.h" diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp index a49eec25fb..b570a65453 100644 --- a/src/gpu/ops/GrMSAAPathRenderer.cpp +++ b/src/gpu/ops/GrMSAAPathRenderer.cpp @@ -14,7 +14,6 @@ #include "GrOpFlushState.h" #include "GrPathStencilSettings.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrSimpleMeshDrawOpHelper.h" #include "SkAutoMalloc.h" #include "SkGeometry.h" diff --git a/src/gpu/ops/GrMeshDrawOp.cpp b/src/gpu/ops/GrMeshDrawOp.cpp index 48f2ea67d3..e42f3197b8 100644 --- a/src/gpu/ops/GrMeshDrawOp.cpp +++ b/src/gpu/ops/GrMeshDrawOp.cpp @@ -95,7 +95,7 @@ void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrPipeline* if (!op->fQueuedDraws.empty()) { // If the last draw shares a geometry processor and pipeline and there are no intervening // uploads, add this mesh to it. - GrLegacyMeshDrawOp::QueuedDraw& lastDraw = op->fQueuedDraws.back(); + GrMeshDrawOp::QueuedDraw& lastDraw = op->fQueuedDraws.back(); if (lastDraw.fGeometryProcessor == gp && lastDraw.fPipeline == pipeline && (op->fInlineUploads.empty() || op->fInlineUploads.back().fUploadBeforeToken != this->nextDrawToken())) { @@ -103,7 +103,7 @@ void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrPipeline* return; } } - GrLegacyMeshDrawOp::QueuedDraw& draw = op->fQueuedDraws.push_back(); + GrMeshDrawOp::QueuedDraw& draw = op->fQueuedDraws.push_back(); GrDrawOpUploadToken token = this->state()->issueDrawToken(); draw.fGeometryProcessor.reset(gp); draw.fPipeline = pipeline; diff --git a/src/gpu/ops/GrMeshDrawOp.h b/src/gpu/ops/GrMeshDrawOp.h index df96455ffd..916806ce74 100644 --- a/src/gpu/ops/GrMeshDrawOp.h +++ b/src/gpu/ops/GrMeshDrawOp.h @@ -12,7 +12,6 @@ #include "GrGeometryProcessor.h" #include "GrMesh.h" #include "GrPendingProgramElement.h" -#include "GrPipelineBuilder.h" #include "SkTLList.h" @@ -91,132 +90,4 @@ private: typedef GrDrawOp INHERITED; }; -/** - * Many of our ops derive from this class which initializes a GrPipeline just before being recorded. - * We are migrating away from use of this class. - */ -class GrLegacyMeshDrawOp : public GrMeshDrawOp { -public: - /** - * Performs analysis of the fragment processors in GrProcessorSet and GrAppliedClip using the - * initial color and coverage from this op's geometry processor. - */ - GrProcessorSet::Analysis analyzeUpdateAndRecordProcessors(GrPipelineBuilder* pipelineBuilder, - const GrAppliedClip* appliedClip, - bool isMixedSamples, - const GrCaps& caps, - GrColor* overrideColor) const { - GrProcessorAnalysisColor inputColor; - GrProcessorAnalysisCoverage inputCoverage; - this->getProcessorAnalysisInputs(&inputColor, &inputCoverage); - return pipelineBuilder->finalizeProcessors(inputColor, inputCoverage, appliedClip, - isMixedSamples, caps, overrideColor); - } - - void initPipeline(const GrPipeline::InitArgs& args, const GrProcessorSet::Analysis& analysis, - GrColor overrideColor) { - fPipeline.init(args); - this->applyPipelineOptimizations(PipelineOptimizations(analysis, overrideColor)); - } - - void addDependenciesTo(GrOpList* opList, const GrCaps& caps) { - fPipeline.addDependenciesTo(opList, caps); - } - - /** - * Mesh draw ops use a legacy system in GrRenderTargetContext where the pipeline is created when - * the op is recorded. These methods are unnecessary as this information is in the pipeline. - */ - FixedFunctionFlags fixedFunctionFlags() const override { - SkFAIL("This should never be called for legacy mesh draw ops."); - return FixedFunctionFlags::kNone; - } - RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override { - SkFAIL("Should never be called for legacy mesh draw ops."); - return RequiresDstTexture::kNo; - } - -protected: - GrLegacyMeshDrawOp(uint32_t classID) : INHERITED(classID) {} - /** - * This is a legacy class only used by GrLegacyMeshDrawOp and will be removed. It presents some - * aspects of GrProcessorSet::Analysis to GrLegacyMeshDrawOp subclasses. - */ - class PipelineOptimizations { - public: - PipelineOptimizations(const GrProcessorSet::Analysis& analysis, GrColor overrideColor) { - fFlags = 0; - if (analysis.inputColorIsOverridden()) { - fFlags |= kUseOverrideColor_Flag; - fOverrideColor = overrideColor; - } - if (analysis.usesLocalCoords()) { - fFlags |= kReadsLocalCoords_Flag; - } - if (analysis.isCompatibleWithCoverageAsAlpha()) { - fFlags |= kCanTweakAlphaForCoverage_Flag; - } - } - - /** Does the pipeline require access to (implicit or explicit) local coordinates? */ - bool readsLocalCoords() const { return SkToBool(kReadsLocalCoords_Flag & fFlags); } - - /** Does the pipeline allow the GrPrimitiveProcessor to combine color and coverage into one - color output ? */ - bool canTweakAlphaForCoverage() const { - return SkToBool(kCanTweakAlphaForCoverage_Flag & fFlags); - } - - /** Does the pipeline require the GrPrimitiveProcessor to specify a specific color (and if - so get the color)? */ - bool getOverrideColorIfSet(GrColor* overrideColor) const { - if (SkToBool(kUseOverrideColor_Flag & fFlags)) { - if (overrideColor) { - *overrideColor = fOverrideColor; - } - return true; - } - return false; - } - - private: - enum { - // If this is not set the primitive processor need not produce local coordinates - kReadsLocalCoords_Flag = 0x1, - // If this flag is set then the primitive processor may produce color*coverage as - // its color output (and not output a separate coverage). - kCanTweakAlphaForCoverage_Flag = 0x2, - // If this flag is set the GrPrimitiveProcessor must produce fOverrideColor as its - // output color. If not set fOverrideColor is to be ignored. - kUseOverrideColor_Flag = 0x4, - }; - - uint32_t fFlags; - GrColor fOverrideColor; - }; - - const GrPipeline* pipeline() const { - SkASSERT(fPipeline.isInitialized()); - return &fPipeline; - } - -private: - /** - * Provides information about the GrPrimitiveProccesor color and coverage outputs which become - * inputs to the first color and coverage fragment processors. - */ - virtual void getProcessorAnalysisInputs(GrProcessorAnalysisColor*, - GrProcessorAnalysisCoverage*) const = 0; - - /** - * After processor analysis is complete this is called so that the op can use the analysis - * results when constructing its GrPrimitiveProcessor. - */ - virtual void applyPipelineOptimizations(const PipelineOptimizations&) = 0; - - GrPipeline fPipeline; - - typedef GrMeshDrawOp INHERITED; -}; - #endif diff --git a/src/gpu/ops/GrOvalOpFactory.h b/src/gpu/ops/GrOvalOpFactory.h index 4c85ee84f5..1bdf3ee6f6 100644 --- a/src/gpu/ops/GrOvalOpFactory.h +++ b/src/gpu/ops/GrOvalOpFactory.h @@ -12,7 +12,6 @@ #include "SkRefCnt.h" class GrDrawOp; -class GrLegacyMeshDrawOp; class GrPaint; class GrShaderCaps; class GrStyle; diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index a43790e4f2..ddb28488a4 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -13,7 +13,6 @@ #include "GrDistanceFieldGenFromVector.h" #include "GrDrawOpTest.h" #include "GrOpFlushState.h" -#include "GrPipelineBuilder.h" #include "GrResourceProvider.h" #include "GrSWMaskHelper.h" #include "GrSimpleMeshDrawOpHelper.h" @@ -383,7 +382,7 @@ private: this->flush(target, &flushInfo); } - bool addDFPathToAtlas(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo, + bool addDFPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo, GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape, uint32_t dimension, SkScalar scale) const { const SkRect& bounds = shape.bounds(); @@ -500,7 +499,7 @@ private: return true; } - bool addBMPathToAtlas(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo, + bool addBMPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo, GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape, const SkMatrix& ctm) const { const SkRect& bounds = shape.bounds(); @@ -672,7 +671,7 @@ private: textureCoords[1] = t; } - void flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const { + void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const { if (flushInfo->fInstancesToFlush) { GrMesh mesh(GrPrimitiveType::kTriangles); int maxInstancesPerDraw = diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp index a613841d9a..4d86efdc0e 100644 --- a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp @@ -12,7 +12,6 @@ #include "GrFixedClip.h" #include "GrGpu.h" #include "GrPath.h" -#include "GrPipelineBuilder.h" #include "GrRenderTargetContextPriv.h" #include "GrResourceProvider.h" #include "GrStencilPathOp.h" diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp index ff16cae4c4..d65e57e374 100644 --- a/src/gpu/ops/GrTessellatingPathRenderer.cpp +++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp @@ -14,7 +14,6 @@ #include "GrMesh.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" -#include "GrPipelineBuilder.h" #include "GrResourceCache.h" #include "GrResourceProvider.h" #include "GrTessellator.h" @@ -104,7 +103,7 @@ private: class DynamicVertexAllocator : public GrTessellator::VertexAllocator { public: - DynamicVertexAllocator(size_t stride, GrLegacyMeshDrawOp::Target* target) + DynamicVertexAllocator(size_t stride, GrMeshDrawOp::Target* target) : VertexAllocator(stride) , fTarget(target) , fVertexBuffer(nullptr) @@ -121,7 +120,7 @@ public: const GrBuffer* vertexBuffer() const { return fVertexBuffer; } int firstVertex() const { return fFirstVertex; } private: - GrLegacyMeshDrawOp::Target* fTarget; + GrMeshDrawOp::Target* fTarget; const GrBuffer* fVertexBuffer; int fVertexCount; int fFirstVertex; diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 835105b4d2..823444c972 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -8,7 +8,6 @@ #include "GrAtlasTextBlob.h" #include "GrBlurUtils.h" #include "GrContext.h" -#include "GrPipelineBuilder.h" #include "GrRenderTargetContext.h" #include "GrTextUtils.h" #include "SkColorFilter.h" diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h index 1bce3414da..5d03d58b11 100644 --- a/src/gpu/text/GrAtlasTextBlob.h +++ b/src/gpu/text/GrAtlasTextBlob.h @@ -24,7 +24,6 @@ class GrBlobRegenHelper; struct GrDistanceFieldAdjustTable; class GrMemoryPool; -class GrLegacyMeshDrawOp; class SkDrawFilter; class SkTextBlob; class SkTextBlobRunIterator; diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h index c47ec65666..458a365a8d 100644 --- a/src/gpu/text/GrAtlasTextContext.h +++ b/src/gpu/text/GrAtlasTextContext.h @@ -20,7 +20,6 @@ class GrDrawOp; class GrRenderTargetContext; -class GrPipelineBuilder; class GrTextBlobCache; class SkGlyph; diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index f53e5fe8ce..7d04a14197 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -10,7 +10,6 @@ #include "GrContext.h" #include "GrPath.h" #include "GrPathRange.h" -#include "GrPipelineBuilder.h" #include "GrRenderTargetContext.h" #include "GrResourceProvider.h" #include "GrTextUtils.h" -- cgit v1.2.3