Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkAAClipBlitterWrapper Class Reference

#include <SkRasterClip.h>

Public Member Functions

 SkAAClipBlitterWrapper ()
 
 SkAAClipBlitterWrapper (const SkRasterClip &, SkBlitter *)
 
 SkAAClipBlitterWrapper (const SkAAClip *, SkBlitter *)
 
void init (const SkRasterClip &, SkBlitter *)
 
const SkIRectgetBounds () const
 
const SkRegiongetRgn () const
 
SkBlittergetBlitter ()
 

Detailed Description

Encapsulates the logic of deciding if we need to change/wrap the blitter for aaclipping. If so, getRgn and getBlitter return modified values. If not, they return the raw blitter and (bw) clip region.

We need to keep the constructor/destructor cost as small as possible, so we can freely put this on the stack, and not pay too much for the case when we're really BW anyways.

Definition at line 163 of file SkRasterClip.h.

Constructor & Destructor Documentation

◆ SkAAClipBlitterWrapper() [1/3]

SkAAClipBlitterWrapper::SkAAClipBlitterWrapper ( )

Definition at line 302 of file SkRasterClip.cpp.

302 {
303 SkDEBUGCODE(fClipRgn = nullptr;)
304 SkDEBUGCODE(fBlitter = nullptr;)
305}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()

◆ SkAAClipBlitterWrapper() [2/3]

SkAAClipBlitterWrapper::SkAAClipBlitterWrapper ( const SkRasterClip clip,
SkBlitter blitter 
)

Definition at line 307 of file SkRasterClip.cpp.

308 {
309 this->init(clip, blitter);
310}
void init(const SkRasterClip &, SkBlitter *)

◆ SkAAClipBlitterWrapper() [3/3]

SkAAClipBlitterWrapper::SkAAClipBlitterWrapper ( const SkAAClip aaclip,
SkBlitter blitter 
)

Definition at line 312 of file SkRasterClip.cpp.

313 {
314 SkASSERT(blitter);
315 SkASSERT(aaclip);
316 fBWRgn.setRect(aaclip->getBounds());
317 fAABlitter.init(blitter, aaclip);
318 // now our return values
319 fClipRgn = &fBWRgn;
320 fBlitter = &fAABlitter;
321}
#define SkASSERT(cond)
Definition: SkAssert.h:116
void init(SkBlitter *blitter, const SkAAClip *aaclip)
Definition: SkAAClip.h:97
const SkIRect & getBounds() const
Definition: SkAAClip.h:34
bool setRect(const SkIRect &rect)
Definition: SkRegion.cpp:192

Member Function Documentation

◆ getBlitter()

SkBlitter * SkAAClipBlitterWrapper::getBlitter ( )
inline

Definition at line 179 of file SkRasterClip.h.

179 {
180 SkASSERT(fBlitter);
181 return fBlitter;
182 }

◆ getBounds()

const SkIRect & SkAAClipBlitterWrapper::getBounds ( ) const
inline

Definition at line 171 of file SkRasterClip.h.

171 {
172 SkASSERT(fClipRgn);
173 return fClipRgn->getBounds();
174 }
const SkIRect & getBounds() const
Definition: SkRegion.h:165

◆ getRgn()

const SkRegion & SkAAClipBlitterWrapper::getRgn ( ) const
inline

Definition at line 175 of file SkRasterClip.h.

175 {
176 SkASSERT(fClipRgn);
177 return *fClipRgn;
178 }

◆ init()

void SkAAClipBlitterWrapper::init ( const SkRasterClip clip,
SkBlitter blitter 
)

Definition at line 323 of file SkRasterClip.cpp.

323 {
324 SkASSERT(blitter);
325 if (clip.isBW()) {
326 fClipRgn = &clip.bwRgn();
327 fBlitter = blitter;
328 } else {
329 const SkAAClip& aaclip = clip.aaRgn();
330 fBWRgn.setRect(aaclip.getBounds());
331 fAABlitter.init(blitter, &aaclip);
332 // now our return values
333 fClipRgn = &fBWRgn;
334 fBlitter = &fAABlitter;
335 }
336}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892

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