Flutter Engine
The Flutter Engine
ClearOp.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 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 ClearOp_DEFINED
9#define ClearOp_DEFINED
10
11#include "include/gpu/GrTypes.h"
14
15class GrOpFlushState;
17
18namespace skgpu::ganesh {
19
20class ClearOp final : public GrOp {
21public:
23
24 // A fullscreen or scissored clear, depending on the clip and proxy dimensions
26 const GrScissorState& scissor,
27 std::array<float, 4> color);
28
30 const GrScissorState& scissor,
31 bool insideMask);
32
33 const char* name() const override { return "Clear"; }
34
35 const std::array<float, 4>& color() const { return fColor; }
36 bool stencilInsideMask() const { return fStencilInsideMask; }
37private:
38 friend class GrOp; // for ctors
39
40 enum class Buffer {
41 kColor = 0b01,
42 kStencilClip = 0b10,
43
44 kBoth = 0b11,
45 };
47
48 ClearOp(Buffer buffer,
49 const GrScissorState& scissor,
50 std::array<float, 4> color,
51 bool stencil);
52
53 CombineResult onCombineIfPossible(GrOp* t, SkArenaAlloc*, const GrCaps& caps) override;
54
56 const GrDstProxyView&, GrXferBarrierFlags renderPassXferBarriers,
57 GrLoadOp colorLoadOp) override {}
58
59 void onPrepare(GrOpFlushState*) override {}
60
61 void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override;
62#if defined(GR_TEST_UTILS)
63 SkString onDumpInfo() const override {
64 SkString string("Scissor [ ");
65 if (fScissor.enabled()) {
66 const SkIRect& r = fScissor.rect();
67 string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom);
68 } else {
69 string.append("disabled");
70 }
71 string.appendf("], Color: {%g, %g, %g, %g}\n", fColor[0], fColor[1], fColor[2], fColor[3]);
72 return string;
73 }
74#endif
75
76 GrScissorState fScissor;
77 std::array<float, 4> fColor;
78 bool fStencilInsideMask;
79 Buffer fBuffer;
80};
81
82GR_MAKE_BITFIELD_CLASS_OPS(ClearOp::Buffer)
83
84} // namespace skgpu::ganesh
85
86#endif // ClearOp_DEFINED
skgpu::ganesh::ClearOp ClearOp
Definition: ClearTest.cpp:47
#define DEFINE_OP_CLASS_ID
Definition: GrOp.h:64
GrLoadOp
Definition: GrTypesPriv.h:155
#define GR_MAKE_BITFIELD_CLASS_OPS(X)
Definition: GrTypes.h:42
#define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X)
Definition: GrTypes.h:77
GrXferBarrierFlags
@ kColor
hue and saturation of source with luminosity of destination
Definition: GrCaps.h:57
Definition: GrOp.h:70
CombineResult
Definition: GrOp.h:99
virtual void onExecute(GrOpFlushState *, const SkRect &chainBounds)=0
std::unique_ptr< GrOp > Owner
Definition: GrOp.h:72
virtual void onPrepare(GrOpFlushState *)=0
virtual void onPrePrepare(GrRecordingContext *, const GrSurfaceProxyView &writeView, GrAppliedClip *, const GrDstProxyView &, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)=0
virtual CombineResult onCombineIfPossible(GrOp *, SkArenaAlloc *, const GrCaps &)
Definition: GrOp.h:305
bool enabled() const
const SkIRect & rect() const
bool stencilInsideMask() const
Definition: ClearOp.h:36
static GrOp::Owner MakeStencilClip(GrRecordingContext *context, const GrScissorState &scissor, bool insideMask)
Definition: ClearOp.cpp:33
const std::array< float, 4 > & color() const
Definition: ClearOp.h:35
const char * name() const override
Definition: ClearOp.h:33
static DEFINE_OP_CLASS_ID GrOp::Owner MakeColor(GrRecordingContext *context, const GrScissorState &scissor, std::array< float, 4 > color)
Definition: ClearOp.cpp:27
AtkStateType state
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
Definition: SkRect.h:32
int32_t fBottom
larger y-axis bounds
Definition: SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition: SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition: SkRect.h:35