Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 242 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 244 of file SkPDFDevice.cpp.

249 : fDevice(device)
250 , fBlendMode(SkBlendMode::kSrcOver)
251 , fClipStack(clipStack)
252 {
253 if (matrix.hasPerspective()) {
254 NOT_IMPLEMENTED(!matrix.hasPerspective(), false);
255 return;
256 }
257 fBlendMode = paint.getBlendMode_or(SkBlendMode::kSrcOver);
258 fContentStream =
259 fDevice->setUpContentEntry(clipStack, matrix, paint, textScale, &fDstFormXObject);
260 }
@ kSrcOver
r = s + (1-sa)*d
#define NOT_IMPLEMENTED(condition, assert)
Definition SkPDFUtils.h:39
const Paint & paint
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 261 of file SkPDFDevice.cpp.

262 : ScopedContentEntry(dev, &dev->cs(), dev->localToDevice(), paint, textScale) {}
SkClipStack & cs()
const SkMatrix & localToDevice() const
Definition SkDevice.h:179

◆ ~ScopedContentEntry()

ScopedContentEntry::~ScopedContentEntry ( )
inline

Definition at line 264 of file SkPDFDevice.cpp.

264 {
265 if (fContentStream) {
266 SkPath* shape = &fShape;
267 if (shape->isEmpty()) {
268 shape = nullptr;
269 }
270 fDevice->finishContentEntry(fClipStack, fBlendMode, fDstFormXObject, shape);
271 }
272 }
bool isEmpty() const
Definition SkPath.cpp:406

Member Function Documentation

◆ needShape()

bool ScopedContentEntry::needShape ( )
inline

Definition at line 278 of file SkPDFDevice.cpp.

278 {
279 switch (fBlendMode) {
289 return true;
290 default:
291 return false;
292 }
293 }
@ 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 296 of file SkPDFDevice.cpp.

296 {
297 if (fBlendMode == SkBlendMode::kClear) {
298 return false;
299 }
300 return true;
301 }

◆ operator bool()

ScopedContentEntry::operator bool ( ) const
inlineexplicit

Definition at line 274 of file SkPDFDevice.cpp.

274{ return fContentStream != nullptr; }

◆ setShape()

void ScopedContentEntry::setShape ( const SkPath shape)
inline

Definition at line 307 of file SkPDFDevice.cpp.

307 {
308 fShape = shape;
309 }

◆ stream()

SkDynamicMemoryWStream * ScopedContentEntry::stream ( )
inline

Definition at line 275 of file SkPDFDevice.cpp.

275{ return fContentStream; }

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