Flutter Engine
The Flutter Engine
FillRectOp.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 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
8#ifndef FillRectOp_DEFINED
9#define FillRectOp_DEFINED
10
13
14struct DrawQuad;
15class GrClip;
16class GrDrawOp;
17class GrPaint;
18class GrQuad;
19struct GrQuadSetEntry;
22class SkMatrix;
23struct SkRect;
24
25namespace skgpu::ganesh {
26
28
29/**
30 * A set of factory functions for drawing filled rectangles either coverage-antialiased, or
31 * non-antialiased. The non-antialiased ops can be used with MSAA. As with other GrDrawOp factories,
32 * the GrPaint is only consumed by these methods if a valid op is returned. If null is returned then
33 * the paint is unmodified and may still be used.
34 */
36public:
38
40 GrPaint&&,
42 DrawQuad*,
43 const GrUserStencilSettings* = nullptr,
45
46 // Utility function to create a non-AA rect transformed by view. This is used commonly enough
47 // in testing and GMs that manage ops without going through GrRTC that it's worth the
48 // convenience.
50 GrPaint&&,
51 const SkMatrix& view,
52 const SkRect&,
53 const GrUserStencilSettings* = nullptr);
54
55 // Bulk API for drawing quads with a single op
56 // TODO(michaelludwig) - remove if the bulk API is not useful for SkiaRenderer
58 const GrClip*,
60 GrPaint&&,
62 const SkMatrix& viewMatrix,
63 const GrQuadSetEntry quads[],
64 int quadCount,
65 const GrUserStencilSettings* = nullptr);
66
67#if defined(GR_TEST_UTILS)
68 static uint32_t ClassID();
69#endif
70
71private:
72 // Create a FillRectOp that uses as many quads as possible from 'quads' w/o exceeding
73 // any index buffer size limits.
74 static GrOp::Owner MakeOp(GrRecordingContext*,
75 GrPaint&&,
77 const SkMatrix& viewMatrix,
78 const GrQuadSetEntry quads[],
79 int quadCount,
81 int* numConsumed);
82};
83
84} // namespace skgpu::ganesh
85
86#endif // FillRectOp_DEFINED
GrAAType
Definition: GrTypesPriv.h:200
Definition: GrClip.h:29
std::unique_ptr< GrOp > Owner
Definition: GrOp.h:72
Definition: GrQuad.h:30
static GrOp::Owner Make(GrRecordingContext *, GrPaint &&, GrAAType, DrawQuad *, const GrUserStencilSettings *=nullptr, InputFlags=InputFlags::kNone)
Definition: FillRectOp.cpp:470
static void AddFillRectOps(SurfaceDrawContext *, const GrClip *, GrRecordingContext *, GrPaint &&, GrAAType, const SkMatrix &viewMatrix, const GrQuadSetEntry quads[], int quadCount, const GrUserStencilSettings *=nullptr)
Definition: FillRectOp.cpp:530
static GrOp::Owner MakeNonAARect(GrRecordingContext *, GrPaint &&, const SkMatrix &view, const SkRect &, const GrUserStencilSettings *=nullptr)
Definition: FillRectOp.cpp:480