Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
core
SkLatticeIter.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015 Google Inc.
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 SkLatticeIter_DEFINED
9
#define SkLatticeIter_DEFINED
10
11
#include "
include/core/SkCanvas.h
"
12
#include "
include/core/SkColor.h
"
13
#include "
include/core/SkRect.h
"
14
#include "
include/core/SkScalar.h
"
15
#include "
include/private/base/SkAPI.h
"
16
#include "
include/private/base/SkTArray.h
"
17
18
class
SkMatrix
;
19
20
/**
21
* Disect a lattice request into an sequence of src-rect / dst-rect pairs
22
*/
23
class
SK_SPI
SkLatticeIter
{
24
public
:
25
26
static
bool
Valid(
int
imageWidth,
int
imageHeight,
const
SkCanvas::Lattice
& lattice);
27
28
SkLatticeIter
(
const
SkCanvas::Lattice
& lattice,
const
SkRect
& dst);
29
30
static
bool
Valid(
int
imageWidth,
int
imageHeight,
const
SkIRect
&
center
);
31
32
SkLatticeIter
(
int
imageWidth,
int
imageHeight,
const
SkIRect
&
center
,
const
SkRect
& dst);
33
34
/**
35
* While it returns true, use src/dst to draw the image/bitmap. Optional parameters
36
* isFixedColor and fixedColor specify if the rectangle is filled with a fixed color.
37
* If (*isFixedColor) is true, then (*fixedColor) contains the rectangle color.
38
*/
39
bool
next
(
SkIRect
* src,
SkRect
* dst,
bool
* isFixedColor =
nullptr
,
40
SkColor
* fixedColor =
nullptr
);
41
42
/** Version of above that converts the integer src rect to a scalar rect. */
43
bool
next
(
SkRect
* src,
SkRect
* dst,
bool
* isFixedColor =
nullptr
,
44
SkColor
* fixedColor =
nullptr
) {
45
SkIRect
isrcR;
46
if
(this->
next
(&isrcR, dst, isFixedColor, fixedColor)) {
47
*src =
SkRect::Make
(isrcR);
48
return
true
;
49
}
50
return
false
;
51
}
52
53
/**
54
* Apply a matrix to the dst points.
55
*/
56
void
mapDstScaleTranslate(
const
SkMatrix
& matrix);
57
58
/**
59
* Returns the number of rects that will actually be drawn.
60
*/
61
int
numRectsToDraw
()
const
{
62
return
fNumRectsToDraw;
63
}
64
65
private
:
66
skia_private::TArray<int>
fSrcX;
67
skia_private::TArray<int>
fSrcY;
68
skia_private::TArray<SkScalar>
fDstX;
69
skia_private::TArray<SkScalar>
fDstY;
70
skia_private::TArray<SkCanvas::Lattice::RectType>
fRectTypes;
71
skia_private::TArray<SkColor>
fColors;
72
73
int
fCurrX;
74
int
fCurrY;
75
int
fNumRectsInLattice;
76
int
fNumRectsToDraw;
77
};
78
79
#endif
next
static float next(float f)
Definition
PathOpsAngleTest.cpp:32
SkAPI.h
SK_SPI
#define SK_SPI
Definition
SkAPI.h:41
SkCanvas.h
SkColor.h
SkColor
uint32_t SkColor
Definition
SkColor.h:37
SkRect.h
SkScalar.h
SkTArray.h
center
static SkScalar center(float pos0, float pos1)
Definition
TouchGesture.cpp:193
SkLatticeIter
Definition
SkLatticeIter.h:23
SkLatticeIter::next
bool next(SkRect *src, SkRect *dst, bool *isFixedColor=nullptr, SkColor *fixedColor=nullptr)
Definition
SkLatticeIter.h:43
SkLatticeIter::numRectsToDraw
int numRectsToDraw() const
Definition
SkLatticeIter.h:61
SkMatrix
Definition
SkMatrix.h:54
skia_private::TArray
Definition
SkTArray.h:40
SkCanvas::Lattice
Definition
SkCanvas.h:1601
SkIRect
Definition
SkRect.h:32
SkRect
Definition
extension.cpp:13
SkRect::Make
static SkRect Make(const SkISize &size)
Definition
SkRect.h:669
Generated on Fri Apr 26 2024 06:16:44 for Flutter Engine by
1.9.8