38#define kEDGE_HEAD_Y SK_MinS32
39#define kEDGE_TAIL_Y SK_MaxS32
54 #define validate_sort(edge)
58 if (newEdge->
fFirstY != curr_y) {
62 if (
prev->fX <= newEdge->
fX) {
71 if (
start->fNext == newEdge) {
75 if (after->
fX >= newEdge->
fX) {
85 }
while (newEdge->
fFirstY == curr_y);
90 while (edge->
fFirstY <= curr_y) {
101 #define validate_edges_for_y(edge, curr_y)
105#pragma warning ( push )
106#pragma warning ( disable : 4701 )
110#define PREPOST_START true
111#define PREPOST_END false
114 SkBlitter* blitter,
int start_y,
int stop_y,
118 int curr_y = start_y;
133 while (currE->
fFirstY <= curr_y) {
138 if ((
w & windingMask) == 0) {
144 if ((
w & windingMask) == 0) {
155 if (currE->
fLastY == curr_y) {
172 newX = currE->
fX + currE->
fDX;
185 if ((
w & windingMask) != 0) {
197 if (curr_y >= stop_y) {
208 if (last_y == edge->
fLastY) {
226#define ASSERT_RETURN(cond) \
229 SkDEBUGFAILF("assert(%s)", #cond); \
247 while (local_top < stop_y) {
252 local_bot =
std::min(local_bot, stop_y - 1);
259 int count = local_bot - local_top;
262 if (0 == (dLeft | dRite)) {
272 local_top = local_bot + 1;
281 blitter->
blitH(
L, local_top,
R -
L);
290 }
while (--
count >= 0);
297 if (currE->
fFirstY >= stop_y) {
301 currE = currE->
fNext;
305 if (currE->
fFirstY >= stop_y) {
309 currE = currE->
fNext;
326 fFirstX =
clip.fLeft << shift;
327 fLastX =
clip.fRight << shift;
333 int invWidth = fLastX - fPrevX;
335 fBlitter->
blitH(fPrevX,
y, invWidth);
342 int invWidth =
x - fPrevX;
344 fBlitter->
blitH(fPrevX,
y, invWidth);
365 int fFirstX, fLastX, fPrevX;
375#pragma warning ( pop )
379 int valuea =
a.fFirstY;
380 int valueb =
b.fFirstY;
382 if (valuea == valueb) {
387 return valuea < valueb;
399 *last = list[
count - 1];
405 int start_y,
int stop_y,
int shiftEdgesUp,
bool pathContainedInClip) {
415 int count =
builder.buildEdges(
path, pathContainedInClip ?
nullptr : &shiftedClip);
419 if (
path.isInverseFillType()) {
427 if (
rect.fTop < start_y) {
430 if (
rect.fBottom > stop_y) {
431 rect.fBottom = stop_y;
433 if (!
rect.isEmpty()) {
435 rect.fTop << shiftEdgesUp,
436 rect.width() << shiftEdgesUp,
437 rect.height() << shiftEdgesUp);
443 SkEdge headEdge, tailEdge, *last;
447 headEdge.
fPrev =
nullptr;
448 headEdge.
fNext = edge;
451 edge->
fPrev = &headEdge;
453 tailEdge.
fPrev = last;
454 tailEdge.
fNext =
nullptr;
456 last->
fNext = &tailEdge;
462 if (!pathContainedInClip && start_y < shiftedClip.
fTop) {
463 start_y = shiftedClip.
fTop;
465 if (!pathContainedInClip && stop_y > shiftedClip.
fBottom) {
472 if (
path.isInverseFillType()) {
479 if (
path.isConvex() && (
nullptr == proc) &&
count >= 2) {
482 walk_edges(&headEdge,
path.getFillType(), blitter, start_y, stop_y, proc,
483 shiftedClip.
right());
521 const SkIRect& ir,
bool skipRejectTest,
bool irPreClipped) {
532 if (!irPreClipped && fClipRect->
contains(ir)) {
534 fRectClipCheckBlitter.init(blitter, *fClipRect);
535 blitter = &fRectClipCheckBlitter;
542 fRectBlitter.
init(blitter, *fClipRect);
543 blitter = &fRectBlitter;
546 fRectClipCheckBlitter.
init(blitter, *fClipRect);
547 blitter = &fRectClipCheckBlitter;
553 blitter = &fRgnBlitter;
564 const int32_t limit = 32767 >> 1;
567 limitR.
setLTRB(-limit, -limit, limit, limit);
633 const SkRegion* clipPtr = &origClip;
639 clipPtr = &finiteClip;
645 bool irPreClipped =
false;
655 if (
path.isInverseFillType()) {
661 SkScanClipper clipper(blitter, clipPtr, ir,
path.isInverseFillType(), irPreClipped);
667 if (
path.isInverseFillType()) {
674 if (
path.isInverseFillType()) {
710 return (
int)(list -
start);
726 SkEdge headEdge, tailEdge, *last;
731 headEdge.
fPrev =
nullptr;
732 headEdge.
fNext = edge;
735 edge->
fPrev = &headEdge;
737 tailEdge.
fPrev = last;
738 tailEdge.
fNext =
nullptr;
740 last->
fNext = &tailEdge;
747 int start_y = ir.
fTop;
748 if (
clipRect && start_y < clipRect->fTop) {
768 path.addPoly(pts, 3,
false);
781 clipRgn = &
clip.bwRgn();
static float next(float f)
static float prev(float f)
#define SkDEBUGFAIL(message)
#define SkFixedRoundToInt(x)
static constexpr int sk_double_saturate2int(double x)
#define SK_INIT_TO_AVOID_WARNING
static constexpr int32_t SkLeftShift(int32_t value, int32_t shift)
static constexpr int32_t SK_MinS32
static constexpr int16_t SK_MaxS16
static constexpr int32_t SK_MaxS32
static bool SkPathFillType_IsEvenOdd(SkPathFillType ft)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static bool left(const SkPoint &p0, const SkPoint &p1)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static constexpr int32_t Sk32_can_overflow_add(int32_t a, int32_t b)
static void remove_edge(EdgeType *edge)
void backward_insert_edge_based_on_x(EdgeType *edge)
static void insert_edge_after(EdgeType *edge, EdgeType *afterMe)
EdgeType * backward_insert_start(EdgeType *prev, SkFixed x)
#define validate_edges_for_y(edge, curr_y)
static SkIRect conservative_round_to_int(const SkRect &src)
void sk_fill_path(const SkPath &path, const SkIRect &clipRect, SkBlitter *blitter, int start_y, int stop_y, int shiftEdgesUp, bool pathContainedInClip)
static SkEdge * sort_edges(SkEdge *list[], int count, SkEdge **last)
static const double kConservativeRoundBias
static bool clip_to_limit(const SkRegion &orig, SkRegion *reduced)
static int round_down_to_int(SkScalar x)
static void walk_simple_edges(SkEdge *prevHead, SkBlitter *blitter, int start_y, int stop_y)
static int round_up_to_int(SkScalar x)
static int build_tri_edges(SkEdge edge[], const SkPoint pts[], const SkIRect *clipRect, SkEdge *list[])
static void insert_new_edges(SkEdge *newEdge, int curr_y)
static void walk_edges(SkEdge *prevHead, SkPathFillType fillType, SkBlitter *blitter, int start_y, int stop_y, PrePostProc proc, int rightClip)
#define ASSERT_RETURN(cond)
static bool update_edge(SkEdge *edge, int last_y)
static void sk_fill_triangle(const SkPoint pts[], const SkIRect *clipRect, SkBlitter *blitter, const SkIRect &ir)
#define validate_sort(edge)
void sk_blit_below(SkBlitter *blitter, const SkIRect &ir, const SkRegion &clip)
void(* PrePostProc)(SkBlitter *blitter, int y, bool isStartOfScanline)
void sk_blit_above(SkBlitter *blitter, const SkIRect &ir, const SkRegion &clip)
static bool operator<(const SkEdge &a, const SkEdge &b)
static void PrePostInverseBlitterProc(SkBlitter *blitter, int y, bool isStart)
void SkTQSort(T *begin, T *end, const C &lessThan)
void setBlitter(SkBlitter *blitter, const SkIRect &clip, int shift)
void blitH(int x, int y, int width) override
Blit a horizontal run of one or more pixels.
void blitAntiH(int, int, const SkAlpha[], const int16_t runs[]) override
void blitMask(const SkMask &, const SkIRect &clip) override
void blitV(int x, int y, int height, SkAlpha alpha) override
Blit a vertical run of pixels with a constant alpha value.
void prepost(int y, bool isStart)
void blitRect(int x, int y, int width, int height) override
Blit a solid rectangle one or more pixels wide.
void init(const SkRasterClip &, SkBlitter *)
const SkRegion & getRgn() const
void blitRectRegion(const SkIRect &rect, const SkRegion &clip)
void blitRegion(const SkRegion &clip)
virtual void blitH(int x, int y, int width)=0
Blit a horizontal run of one or more pixels.
virtual void blitRect(int x, int y, int width, int height)
Blit a solid rectangle one or more pixels wide.
const SkRect & getBounds() const
bool isRect(SkRect *rect, bool *isClosed=nullptr, SkPathDirection *direction=nullptr) const
void init(SkBlitter *blitter, const SkIRect &clipRect)
static SkRect MakeLargeS32()
@ kIntersect_Op
target intersected with operand
const SkIRect & getBounds() const
bool op(const SkIRect &rect, Op op)
void init(SkBlitter *blitter, const SkRegion *clipRgn)
SkScanClipper(SkBlitter *blitter, const SkRegion *clip, const SkIRect &bounds, bool skipRejectTest=false, bool boundsPreClipped=false)
SkBlitter * getBlitter() const
const SkIRect * getClipRect() const
static bool PathRequiresTiling(const SkIRect &bounds)
static void FillPath(const SkPath &, const SkIRect &, SkBlitter *)
static void FillTriangle(const SkPoint pts[], const SkRasterClip &, SkBlitter *)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
Optional< SkRect > bounds
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
sk_sp< SkBlender > blender SkRect rect
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
constexpr bool contains(std::string_view str, std::string_view needle)
SIN Vec< N, float > floor(const Vec< N, float > &x)
SIN Vec< N, float > ceil(const Vec< N, float > &x)
int setLine(const SkPoint &p0, const SkPoint &p1, const SkIRect *clip, int shiftUp)
static bool Intersects(const SkIRect &a, const SkIRect &b)
int32_t fBottom
larger y-axis bounds
constexpr int32_t right() const
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom)
bool contains(int32_t x, int32_t y) const
int32_t fRight
larger x-axis bounds
void setBounds(const SkPoint pts[], int count)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)