Flutter Engine
The Flutter Engine
GrSimpleMeshDrawOpHelperWithStencil.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
11 GrProcessorSet* processorSet,
12 GrAAType aaType,
13 const GrUserStencilSettings* stencilSettings,
14 InputFlags inputFlags)
15 : INHERITED(processorSet, aaType, inputFlags)
16 , fStencilSettings(stencilSettings ? stencilSettings : &GrUserStencilSettings::kUnused) {}
17
20 if (fStencilSettings != &GrUserStencilSettings::kUnused) {
22 }
23 return flags;
24}
25
27 const GrCaps& caps, const GrAppliedClip* clip, GrClampType clampType,
28 GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor, bool* wideColor) {
29 GrProcessorAnalysisColor color = *geometryColor;
30 auto result = this->finalizeProcessors(caps, clip, clampType, geometryCoverage, &color);
31 color.isConstant(geometryColor);
32 if (wideColor) {
33 *wideColor = !geometryColor->fitsInBytes();
34 }
35 return result;
36}
37
39 const GrSimpleMeshDrawOpHelperWithStencil& that, const GrCaps& caps,
40 const SkRect& thisBounds, const SkRect& thatBounds, bool ignoreAAType) const {
41 return INHERITED::isCompatible(that, caps, thisBounds, thatBounds, ignoreAAType) &&
42 fStencilSettings == that.fStencilSettings;
43}
44
46 const GrCaps* caps,
47 SkArenaAlloc* arena,
48 const GrSurfaceProxyView& writeView,
49 bool usesMSAASurface,
50 GrAppliedClip&& appliedClip,
51 const GrDstProxyView& dstProxyView,
53 GrPrimitiveType primType,
54 GrXferBarrierFlags renderPassXferBarriers,
55 GrLoadOp colorLoadOp) {
56 return CreateProgramInfo(caps,
57 arena,
58 writeView,
59 usesMSAASurface,
60 std::move(appliedClip),
61 dstProxyView,
62 gp,
63 this->detachProcessorSet(),
64 primType,
65 renderPassXferBarriers,
66 colorLoadOp,
67 this->pipelineFlags(),
68 this->stencilSettings());
69}
70
71#if defined(GR_TEST_UTILS)
72SkString GrSimpleMeshDrawOpHelperWithStencil::dumpInfo() const {
73 SkString result = INHERITED::dumpInfo();
74 result.appendf("Stencil settings: %s\n", (fStencilSettings ? "yes" : "no"));
75 return result;
76}
77#endif
GrProcessorAnalysisCoverage
GrClampType
Definition: GrTypesPriv.h:228
GrPrimitiveType
Definition: GrTypesPriv.h:43
GrAAType
Definition: GrTypesPriv.h:200
GrLoadOp
Definition: GrTypesPriv.h:155
GrXferBarrierFlags
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
Definition: GrCaps.h:57
FixedFunctionFlags
Definition: GrDrawOp.h:104
GrProcessorSet::Analysis finalizeProcessors(const GrCaps &caps, const GrAppliedClip *clip, GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor *geometryColor)
GrDrawOp::FixedFunctionFlags fixedFunctionFlags() const
bool isCompatible(const GrSimpleMeshDrawOpHelperWithStencil &that, const GrCaps &, const SkRect &thisBounds, const SkRect &thatBounds, bool ignoreAAType=false) const
GrPipeline::InputFlags pipelineFlags() const
GrSimpleMeshDrawOpHelperWithStencil(GrProcessorSet *, GrAAType, const GrUserStencilSettings *, InputFlags=InputFlags::kNone)
const GrUserStencilSettings * stencilSettings() const
GrProgramInfo * createProgramInfoWithStencil(const GrCaps *, SkArenaAlloc *, const GrSurfaceProxyView &writeView, bool usesMSAASurface, GrAppliedClip &&, const GrDstProxyView &, GrGeometryProcessor *, GrPrimitiveType, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
GrDrawOp::FixedFunctionFlags fixedFunctionFlags() const
static GrProgramInfo * CreateProgramInfo(const GrCaps *, SkArenaAlloc *, const GrPipeline *, const GrSurfaceProxyView &writeView, bool usesMSAASurface, GrGeometryProcessor *, GrPrimitiveType, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp, const GrUserStencilSettings *=&GrUserStencilSettings::kUnused)
bool isCompatible(const GrSimpleMeshDrawOpHelper &that, const GrCaps &, const SkRect &thisBounds, const SkRect &thatBounds, bool ignoreAAType=false) const
DlColor color
FlutterSemanticsFlag flags
GAsyncResult * result
static const GrUserStencilSettings & kUnused
bool fitsInBytes() const
Definition: SkColor.h:350