Flutter Engine
The Flutter Engine
Namespaces | Macros | Functions
SkPicturePlayback.cpp File Reference
#include "src/core/SkPicturePlayback.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkClipOp.h"
#include "include/core/SkColor.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkRegion.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkScalar.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkTArray.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkSafeMath.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkPictureData.h"
#include "src/core/SkPictureFlat.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkVerticesPriv.h"
#include "src/utils/SkPatchUtils.h"

Go to the source code of this file.

Namespaces

namespace  sktext
 
namespace  sktext::gpu
 

Macros

#define BREAK_ON_READ_ERROR(r)   if (!r->isValid()) break
 

Functions

static const SkRectget_rect_ptr (SkReadBuffer *reader, SkRect *storage)
 
static void validate_offsetToRestore (SkReadBuffer *reader, size_t offsetToRestore)
 
static bool do_clip_op (SkReadBuffer *reader, SkCanvas *canvas, SkRegion::Op op, SkClipOp *clipOpToUse)
 

Macro Definition Documentation

◆ BREAK_ON_READ_ERROR

#define BREAK_ON_READ_ERROR (   r)    if (!r->isValid()) break

Function Documentation

◆ do_clip_op()

static bool do_clip_op ( SkReadBuffer reader,
SkCanvas canvas,
SkRegion::Op  op,
SkClipOp clipOpToUse 
)
static

Definition at line 108 of file SkPicturePlayback.cpp.

109 {
110 switch(op) {
113 // Fully supported, identity mapping between SkClipOp and Region::Op
114 *clipOpToUse = static_cast<SkClipOp>(op);
115 return true;
117 // Emulate the replace by resetting first and following it up with an intersect
120 *clipOpToUse = SkClipOp::kIntersect;
121 return true;
122 default:
123 // An expanding clip op, which if encountered on an old SKP, we just silently ignore
125 return false;
126 }
127}
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkClipOp
Definition: SkClipOp.h:13
static void ResetClip(SkCanvas *canvas)
Definition: SkCanvasPriv.h:61
bool isVersionLT(SkPicturePriv::Version targetVersion) const
Definition: SkReadBuffer.h:64
@ kReplace_Op
replace target with operand
Definition: SkRegion.h:372
@ kIntersect_Op
target intersected with operand
Definition: SkRegion.h:368
@ kDifference_Op
target minus operand
Definition: SkRegion.h:367

◆ get_rect_ptr()

static const SkRect * get_rect_ptr ( SkReadBuffer reader,
SkRect storage 
)
static

Definition at line 51 of file SkPicturePlayback.cpp.

51 {
52 if (reader->readBool()) {
53 reader->readRect(storage);
54 return storage;
55 } else {
56 return nullptr;
57 }
58}
void readRect(SkRect *rect)

◆ validate_offsetToRestore()

static void validate_offsetToRestore ( SkReadBuffer reader,
size_t  offsetToRestore 
)
static

Definition at line 102 of file SkPicturePlayback.cpp.

102 {
103 if (offsetToRestore) {
104 reader->validate(SkIsAlign4(offsetToRestore) && offsetToRestore >= reader->offset());
105 }
106}
static constexpr bool SkIsAlign4(T x)
Definition: SkAlign.h:20
bool validate(bool isValid)
Definition: SkReadBuffer.h:191
size_t offset() const
Definition: SkReadBuffer.h:78