Flutter Engine
The Flutter Engine
Functions
SkDraw_atlas.cpp File Reference
#include "include/core/SkAlphaType.h"
#include "include/core/SkColor.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurfaceProps.h"
#include "src/base/SkArenaAlloc.h"
#include "src/core/SkBlendModePriv.h"
#include "src/core/SkBlenderBase.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkColorSpaceXformSteps.h"
#include "src/core/SkCoreBlitters.h"
#include "src/core/SkDraw.h"
#include "src/core/SkEffectPriv.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkRasterPipelineOpContexts.h"
#include "src/core/SkRasterPipelineOpList.h"
#include "src/core/SkScan.h"
#include "src/core/SkSurfacePriv.h"
#include "src/shaders/SkShaderBase.h"
#include "src/shaders/SkTransformShader.h"
#include <cstdint>
#include <optional>

Go to the source code of this file.

Functions

static void fill_rect (const SkMatrix &ctm, const SkRasterClip &rc, const SkRect &r, SkBlitter *blitter, SkPath *scratchPath)
 
static void load_color (SkRasterPipeline_UniformColorCtx *ctx, const float rgba[])
 

Function Documentation

◆ fill_rect()

static void fill_rect ( const SkMatrix ctm,
const SkRasterClip rc,
const SkRect r,
SkBlitter blitter,
SkPath scratchPath 
)
static

Definition at line 46 of file SkDraw_atlas.cpp.

47 {
48 if (ctm.rectStaysRect()) {
49 SkRect dr;
50 ctm.mapRect(&dr, r);
51 SkScan::FillRect(dr, rc, blitter);
52 } else {
53 SkPoint pts[4];
54 r.toQuad(pts);
55 ctm.mapPoints(pts, pts, 4);
56
57 scratchPath->rewind();
58 scratchPath->addPoly(pts, 4, true);
59 SkScan::FillPath(*scratchPath, rc, blitter);
60 }
61}
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
Definition: SkMatrix.cpp:770
bool rectStaysRect() const
Definition: SkMatrix.h:271
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141
SkPath & addPoly(const SkPoint pts[], int count, bool close)
Definition: SkPath.cpp:890
SkPath & rewind()
Definition: SkPath.cpp:382
static void FillRect(const SkRect &, const SkRasterClip &, SkBlitter *)
Definition: SkScan.cpp:95
static void FillPath(const SkPath &, const SkIRect &, SkBlitter *)
void toQuad(SkPoint quad[4]) const
Definition: SkRect.cpp:50

◆ load_color()

static void load_color ( SkRasterPipeline_UniformColorCtx ctx,
const float  rgba[] 
)
static

Definition at line 63 of file SkDraw_atlas.cpp.

63 {
64 // only need one of these. can I query the pipeline to know if its lowp or highp?
65 ctx->rgba[0] = SkScalarRoundToInt(rgba[0]*255); ctx->r = rgba[0];
66 ctx->rgba[1] = SkScalarRoundToInt(rgba[1]*255); ctx->g = rgba[1];
67 ctx->rgba[2] = SkScalarRoundToInt(rgba[2]*255); ctx->b = rgba[2];
68 ctx->rgba[3] = SkScalarRoundToInt(rgba[3]*255); ctx->a = rgba[3];
69}
static const uint32_t rgba[kNumPixels]
#define SkScalarRoundToInt(x)
Definition: SkScalar.h:37