Flutter Engine
The Flutter Engine
SkSpriteBlitter.h
Go to the documentation of this file.
1/*
2 * Copyright 2006 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSpriteBlitter_DEFINED
9#define SkSpriteBlitter_DEFINED
10
13#include "src/core/SkBlitter.h"
14
15class SkPaint;
16
17// SkSpriteBlitter specializes SkBlitter in a way to move large rectangles of pixels around.
18// Because of this use, the main primitive shifts from blitH style things to the more efficient
19// blitRect.
20class SkSpriteBlitter : public SkBlitter {
21public:
23
24 virtual bool setup(const SkPixmap& dst, int left, int top, const SkPaint&);
25
26 // blitH, blitAntiH, blitV and blitMask should not be called on an SkSpriteBlitter.
27 void blitH(int x, int y, int width) override;
28 void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override;
29 void blitV(int x, int y, int height, SkAlpha alpha) override;
30 void blitMask(const SkMask&, const SkIRect& clip) override;
31
32 // A SkSpriteBlitter must implement blitRect.
33 void blitRect(int x, int y, int width, int height) override = 0;
34
36
37protected:
40 int fLeft, fTop;
42
43private:
44 using INHERITED = SkBlitter;
45};
46
47#endif
uint8_t SkAlpha
Definition: SkColor.h:26
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
static bool left(const SkPoint &p0, const SkPoint &p1)
SkSpriteBlitter(const SkPixmap &source)
const SkPaint * fPaint
const SkPixmap fSource
static SkSpriteBlitter * ChooseL32(const SkPixmap &source, const SkPaint &, SkArenaAlloc *)
void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override
void blitV(int x, int y, int height, SkAlpha alpha) override
Blit a vertical run of pixels with a constant alpha value.
void blitRect(int x, int y, int width, int height) override=0
Blit a solid rectangle one or more pixels wide.
void blitH(int x, int y, int width) override
Blit a horizontal run of one or more pixels.
virtual bool setup(const SkPixmap &dst, int left, int top, const SkPaint &)
void blitMask(const SkMask &, const SkIRect &clip) override
SkBitmap source
Definition: examples.cpp:28
double y
double x
dst
Definition: cp.py:12
int32_t height
int32_t width
Definition: SkRect.h:32
Definition: SkMask.h:25