Flutter Engine
The Flutter Engine
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 200 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 204 of file Device.cpp.

204 {
205 auto& trees = fTrees[drawOrder];
207 for (auto&& tree : trees) {
208 if (tree->add(rect)) {
209 return stencil;
210 }
211 stencil = stencil.next(); // advance to the next tree's index
212 }
213
214 // If here, no existing intersection tree can hold the rect so add a new one
215 IntersectionTree* newTree = this->makeTree();
216 SkAssertResult(newTree->add(rect));
217 trees.push_back(newTree);
218 return stencil;
219 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static constexpr DisjointStencilIndex kUnassigned
Definition: DrawOrder.h:115
MonotonicValue next() const
Definition: DrawOrder.h:42
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
MonotonicValue< DisjointStencilIndexSequence > DisjointStencilIndex
Definition: DrawOrder.h:75

◆ reset()

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

Definition at line 221 of file Device.cpp.

221 {
222 fTrees.clear();
223 fTreeStore.reset();
224 }

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