Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
skgpu::graphite::Device::IntersectionTreeSet Class Reference

Public Member Functions

 IntersectionTreeSet ()=default
 
DisjointStencilIndex add (CompressedPaintersOrder drawOrder, Rect rect)
 
void reset ()
 

Detailed Description

IntersectionTreeSet controls multiple IntersectionTrees to organize all add rectangles into disjoint sets. For a given CompressedPaintersOrder and bounds, it returns the smallest DisjointStencilIndex that guarantees the bounds are disjoint from all other draws that use the same painters order and stencil index.

Definition at line 193 of file Device.cpp.

Constructor & Destructor Documentation

◆ IntersectionTreeSet()

skgpu::graphite::Device::IntersectionTreeSet::IntersectionTreeSet ( )
default

Member Function Documentation

◆ add()

DisjointStencilIndex skgpu::graphite::Device::IntersectionTreeSet::add ( CompressedPaintersOrder  drawOrder,
Rect  rect 
)
inline

Definition at line 197 of file Device.cpp.

197 {
198 auto& trees = fTrees[drawOrder];
200 for (auto&& tree : trees) {
201 if (tree->add(rect)) {
202 return stencil;
203 }
204 stencil = stencil.next(); // advance to the next tree's index
205 }
206
207 // If here, no existing intersection tree can hold the rect so add a new one
208 IntersectionTree* newTree = this->makeTree();
209 SkAssertResult(newTree->add(rect));
210 trees.push_back(newTree);
211 return stencil;
212 }
#define SkAssertResult(cond)
Definition SkAssert.h:123
static constexpr DisjointStencilIndex kUnassigned
Definition DrawOrder.h:115
MonotonicValue next() const
Definition DrawOrder.h:42
MonotonicValue< DisjointStencilIndexSequence > DisjointStencilIndex
Definition DrawOrder.h:75

◆ reset()

void skgpu::graphite::Device::IntersectionTreeSet::reset ( )
inline

Definition at line 214 of file Device.cpp.

214 {
215 fTrees.clear();
216 fTreeStore.reset();
217 }

The documentation for this class was generated from the following file: