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

Public Member Functions

 ScopedContentEntry (SkPDFDevice *device, const SkClipStack *clipStack, const SkMatrix &matrix, const SkPaint &paint, SkScalar textScale=0)
 
 ScopedContentEntry (SkPDFDevice *dev, const SkPaint &paint, SkScalar textScale=0)
 
 ~ScopedContentEntry ()
 
 operator bool () const
 
SkDynamicMemoryWStreamstream ()
 
bool needShape ()
 
bool needSource ()
 
void setShape (const SkPath &shape)
 

Detailed Description

Definition at line 274 of file SkPDFDevice.cpp.

Constructor & Destructor Documentation

◆ ScopedContentEntry() [1/2]

ScopedContentEntry::ScopedContentEntry ( SkPDFDevice device,
const SkClipStack clipStack,
const SkMatrix matrix,
const SkPaint paint,
SkScalar  textScale = 0 
)
inline

Definition at line 276 of file SkPDFDevice.cpp.

281 : fDevice(device)
282 , fBlendMode(SkBlendMode::kSrcOver)
283 , fClipStack(clipStack)
284 {
285 if (matrix.hasPerspective()) {
286 NOT_IMPLEMENTED(!matrix.hasPerspective(), false);
287 return;
288 }
289 fBlendMode = paint.getBlendMode_or(SkBlendMode::kSrcOver);
290 fContentStream =
291 fDevice->setUpContentEntry(clipStack, matrix, paint, textScale, &fDstFormXObject);
292 }
@ kSrcOver
r = s + (1-sa)*d
#define NOT_IMPLEMENTED(condition, assertion)
Definition: SkPDFUtils.h:51
const Paint & paint
Definition: color_source.cc:38
VkDevice device
Definition: main.cc:53
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ ScopedContentEntry() [2/2]

ScopedContentEntry::ScopedContentEntry ( SkPDFDevice dev,
const SkPaint paint,
SkScalar  textScale = 0 
)
inline

Definition at line 293 of file SkPDFDevice.cpp.

294 : ScopedContentEntry(dev, &dev->cs(), dev->localToDevice(), paint, textScale) {}
ScopedContentEntry(SkPDFDevice *device, const SkClipStack *clipStack, const SkMatrix &matrix, const SkPaint &paint, SkScalar textScale=0)
SkClipStack & cs()
const SkMatrix & localToDevice() const
Definition: SkDevice.h:179

◆ ~ScopedContentEntry()

ScopedContentEntry::~ScopedContentEntry ( )
inline

Definition at line 296 of file SkPDFDevice.cpp.

296 {
297 if (fContentStream) {
298 SkPath* shape = &fShape;
299 if (shape->isEmpty()) {
300 shape = nullptr;
301 }
302 fDevice->finishContentEntry(fClipStack, fBlendMode, fDstFormXObject, shape);
303 }
304 }
Definition: SkPath.h:59
bool isEmpty() const
Definition: SkPath.cpp:416

Member Function Documentation

◆ needShape()

bool ScopedContentEntry::needShape ( )
inline

Definition at line 310 of file SkPDFDevice.cpp.

310 {
311 switch (fBlendMode) {
321 return true;
322 default:
323 return false;
324 }
325 }
@ kSrcOut
r = s * (1-da)
@ kDstIn
r = d * sa
@ kModulate
r = s*d
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOut
r = d * (1-sa)
@ kSrcIn
r = s * da
@ kClear
r = 0

◆ needSource()

bool ScopedContentEntry::needSource ( )
inline

Definition at line 328 of file SkPDFDevice.cpp.

328 {
329 if (fBlendMode == SkBlendMode::kClear) {
330 return false;
331 }
332 return true;
333 }

◆ operator bool()

ScopedContentEntry::operator bool ( ) const
inlineexplicit

Definition at line 306 of file SkPDFDevice.cpp.

306{ return fContentStream != nullptr; }

◆ setShape()

void ScopedContentEntry::setShape ( const SkPath shape)
inline

Definition at line 339 of file SkPDFDevice.cpp.

339 {
340 fShape = shape;
341 }

◆ stream()

SkDynamicMemoryWStream * ScopedContentEntry::stream ( )
inline

Definition at line 307 of file SkPDFDevice.cpp.

307{ return fContentStream; }

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