Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
SkRecords::FillBounds Class Reference
Inheritance diagram for SkRecords::FillBounds:
SkNoncopyable

Public Types

typedef SkRect Bounds
 

Public Member Functions

 FillBounds (const SkRect &cullRect, const SkRecord &record, SkRect bounds[], SkBBoxHierarchy::Metadata meta[])
 
 ~FillBounds ()
 
void setCurrentOp (int currentOp)
 
template<typename T >
void operator() (const T &op)
 
Bounds adjustAndMap (SkRect rect, const SkPaint *paint) const
 

Detailed Description

Definition at line 204 of file SkRecordDraw.cpp.

Member Typedef Documentation

◆ Bounds

Definition at line 239 of file SkRecordDraw.cpp.

Constructor & Destructor Documentation

◆ FillBounds()

SkRecords::FillBounds::FillBounds ( const SkRect cullRect,
const SkRecord record,
SkRect  bounds[],
SkBBoxHierarchy::Metadata  meta[] 
)
inline

Definition at line 206 of file SkRecordDraw.cpp.

208 : fCullRect(cullRect)
209 , fBounds(bounds)
210 , fMeta(meta) {
211 fCTM = SkMatrix::I();
212
213 // We push an extra save block to track the bounds of any top-level control operations.
214 fSaveStack.push_back({ 0, Bounds::MakeEmpty(), nullptr, fCTM });
215 }
static const SkMatrix & I()
void push_back(const T &v)
Definition SkTDArray.h:219
Optional< SkRect > bounds
Definition SkRecords.h:189
static constexpr SkRect MakeEmpty()
Definition SkRect.h:595

◆ ~FillBounds()

SkRecords::FillBounds::~FillBounds ( )
inline

Definition at line 217 of file SkRecordDraw.cpp.

217 {
218 // If we have any lingering unpaired Saves, simulate restores to make
219 // sure all ops in those Save blocks have their bounds calculated.
220 while (!fSaveStack.empty()) {
221 this->popSaveBlock();
222 }
223
224 // Any control ops not part of any Save/Restore block draw everywhere.
225 while (!fControlIndices.empty()) {
226 this->popControl(fCullRect);
227 }
228 }
bool empty() const
Definition SkTDArray.h:135

Member Function Documentation

◆ adjustAndMap()

Bounds SkRecords::FillBounds::adjustAndMap ( SkRect  rect,
const SkPaint paint 
) const
inline

Definition at line 242 of file SkRecordDraw.cpp.

242 {
243 // Inverted rectangles really confuse our BBHs.
244 rect.sort();
245
246 // Adjust the rect for its own paint.
247 if (!AdjustForPaint(paint, &rect)) {
248 // The paint could do anything to our bounds. The only safe answer is the cull.
249 return fCullRect;
250 }
251
252 // Adjust rect for all the paints from the SaveLayers we're inside.
253 if (!this->adjustForSaveLayerPaints(&rect)) {
254 // Same deal as above.
255 return fCullRect;
256 }
257
258 // Map the rect back to identity space.
259 fCTM.mapRect(&rect);
260
261 // Nothing can draw outside the cull rect.
262 if (!rect.intersect(fCullRect)) {
263 return Bounds::MakeEmpty();
264 }
265
266 return rect;
267 }
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
Optional< SkPaint > paint
Definition SkRecords.h:190

◆ operator()()

template<typename T >
void SkRecords::FillBounds::operator() ( const T op)
inline

Definition at line 233 of file SkRecordDraw.cpp.

233 {
234 this->updateCTM(op);
235 this->trackBounds(op);
236 }

◆ setCurrentOp()

void SkRecords::FillBounds::setCurrentOp ( int  currentOp)
inline

Definition at line 230 of file SkRecordDraw.cpp.

230{ fCurrentOp = currentOp; }

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