#include "include/core/SkColor.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkRect.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkMath.h"
#include "include/private/base/SkSafe32.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkTSort.h"
#include "src/core/SkAlphaRuns.h"
#include "src/core/SkAnalyticEdge.h"
#include "src/core/SkBlitter.h"
#include "src/core/SkEdge.h"
#include "src/core/SkEdgeBuilder.h"
#include "src/core/SkMask.h"
#include "src/core/SkScan.h"
#include "src/core/SkScanPriv.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
static void add_alpha(SkAlpha* alpha, SkAlpha delta) { … }
static void safely_add_alpha(SkAlpha* alpha, SkAlpha delta) { … }
class AdditiveBlitter : public SkBlitter { … };
class MaskAdditiveBlitter : public AdditiveBlitter { … };
MaskAdditiveBlitter::MaskAdditiveBlitter(SkBlitter* realBlitter,
const SkIRect& ir,
const SkIRect& clipBounds,
bool isInverse)
: … { … }
void MaskAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], int len) { … }
void MaskAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha alpha) { … }
void MaskAdditiveBlitter::blitAntiH(int x, int y, int width, const SkAlpha alpha) { … }
void MaskAdditiveBlitter::blitV(int x, int y, int height, SkAlpha alpha) { … }
void MaskAdditiveBlitter::blitRect(int x, int y, int width, int height) { … }
void MaskAdditiveBlitter::blitAntiRect(int x,
int y,
int width,
int height,
SkAlpha leftAlpha,
SkAlpha rightAlpha) { … }
class RunBasedAdditiveBlitter : public AdditiveBlitter { … };
RunBasedAdditiveBlitter::RunBasedAdditiveBlitter(SkBlitter* realBlitter,
const SkIRect& ir,
const SkIRect& clipBounds,
bool isInverse) { … }
void RunBasedAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], int len) { … }
void RunBasedAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha alpha) { … }
void RunBasedAdditiveBlitter::blitAntiH(int x, int y, int width, const SkAlpha alpha) { … }
class SafeRLEAdditiveBlitter : public RunBasedAdditiveBlitter { … };
void SafeRLEAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], int len) { … }
void SafeRLEAdditiveBlitter::blitAntiH(int x, int y, const SkAlpha alpha) { … }
void SafeRLEAdditiveBlitter::blitAntiH(int x, int y, int width, const SkAlpha alpha) { … }
static SkAlpha trapezoid_to_alpha(SkFixed l1, SkFixed l2) { … }
static SkAlpha partial_triangle_to_alpha(SkFixed a, SkFixed b) { … }
static SkAlpha get_partial_alpha(SkAlpha alpha, SkFixed partialHeight) { … }
static SkAlpha get_partial_alpha(SkAlpha alpha, SkAlpha fullAlpha) { … }
static SkAlpha fixed_to_alpha(SkFixed f) { … }
static SkFixed approximate_intersection(SkFixed l1, SkFixed r1, SkFixed l2, SkFixed r2) { … }
static void compute_alpha_above_line(SkAlpha* alphas,
SkFixed l,
SkFixed r,
SkFixed dY,
SkAlpha fullAlpha) { … }
static void compute_alpha_below_line(SkAlpha* alphas,
SkFixed l,
SkFixed r,
SkFixed dY,
SkAlpha fullAlpha) { … }
static void blit_single_alpha(AdditiveBlitter* blitter,
int y,
int x,
SkAlpha alpha,
SkAlpha fullAlpha,
SkAlpha* maskRow,
bool noRealBlitter) { … }
static void blit_two_alphas(AdditiveBlitter* blitter,
int y,
int x,
SkAlpha a1,
SkAlpha a2,
SkAlpha fullAlpha,
SkAlpha* maskRow,
bool noRealBlitter) { … }
static void blit_full_alpha(AdditiveBlitter* blitter,
int y,
int x,
int len,
SkAlpha fullAlpha,
SkAlpha* maskRow,
bool noRealBlitter) { … }
static void blit_aaa_trapezoid_row(AdditiveBlitter* blitter,
int y,
SkFixed ul,
SkFixed ur,
SkFixed ll,
SkFixed lr,
SkFixed lDY,
SkFixed rDY,
SkAlpha fullAlpha,
SkAlpha* maskRow,
bool noRealBlitter) { … }
static void blit_trapezoid_row(AdditiveBlitter* blitter,
int y,
SkFixed ul,
SkFixed ur,
SkFixed ll,
SkFixed lr,
SkFixed lDY,
SkFixed rDY,
SkAlpha fullAlpha,
SkAlpha* maskRow,
bool noRealBlitter) { … }
static bool operator<(const SkAnalyticEdge& a, const SkAnalyticEdge& b) { … }
static SkAnalyticEdge* sort_edges(SkAnalyticEdge* list[], int count, SkAnalyticEdge** last) { … }
static void validate_sort(const SkAnalyticEdge* edge) { … }
static bool is_smooth_enough(SkAnalyticEdge* thisEdge, SkAnalyticEdge* nextEdge, int stop_y) { … }
static bool is_smooth_enough(SkAnalyticEdge* leftE,
SkAnalyticEdge* riteE,
SkAnalyticEdge* currE,
int stop_y) { … }
static void aaa_walk_convex_edges(SkAnalyticEdge* prevHead,
AdditiveBlitter* blitter,
int start_y,
int stop_y,
SkFixed leftBound,
SkFixed riteBound,
bool isUsingMask) { … }
static void update_next_next_y(SkFixed y, SkFixed nextY, SkFixed* nextNextY) { … }
static void check_intersection(const SkAnalyticEdge* edge, SkFixed nextY, SkFixed* nextNextY) { … }
static void check_intersection_fwd(const SkAnalyticEdge* edge, SkFixed nextY, SkFixed* nextNextY) { … }
static void insert_new_edges(SkAnalyticEdge* newEdge, SkFixed y, SkFixed* nextNextY) { … }
static void validate_edges_for_y(const SkAnalyticEdge* edge, SkFixed y) { … }
static bool edges_too_close(SkAnalyticEdge* prev, SkAnalyticEdge* next, SkFixed lowerY) { … }
static bool edges_too_close(int prevRite, SkFixed ul, SkFixed ll) { … }
static void aaa_walk_edges(SkAnalyticEdge* prevHead,
SkAnalyticEdge* nextTail,
SkPathFillType fillType,
AdditiveBlitter* blitter,
int start_y,
int stop_y,
SkFixed leftClip,
SkFixed rightClip,
bool isUsingMask,
bool forceRLE,
bool skipIntersect) { … }
static void aaa_fill_path(const SkPath& path,
const SkIRect& clipRect,
AdditiveBlitter* blitter,
int start_y,
int stop_y,
bool pathContainedInClip,
bool isUsingMask,
bool forceRLE) { … }
static inline bool try_blit_fat_anti_rect(SkBlitter* blitter,
const SkPath& path,
const SkIRect& clip) { … }
void SkScan::AAAFillPath(const SkPath& path,
SkBlitter* blitter,
const SkIRect& ir,
const SkIRect& clipBounds,
bool forceRLE) { … }