diff options
author | 2016-08-02 08:05:56 -0700 | |
---|---|---|
committer | 2016-08-02 08:05:56 -0700 | |
commit | c573a40ed5024b463e47088d307e3164a486dba5 (patch) | |
tree | 17969315cf64ce827395c4b8ad9273cc6f96886d /src/core/SkRecorder.cpp | |
parent | 7d0e3bc785fc5aaf2ed0aa8f37a2bc85c2f82da0 (diff) |
Add drawImageLattice() and drawBitmapLattice() APIs
The specified image/bitmap is divided into rects, which
can be draw stretched, shrunk, or at a fixed size. Will be
used by Android to draw 9patch (which are acutally N-patch)
images.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1992283002
Review-Url: https://codereview.chromium.org/1992283002
Diffstat (limited to 'src/core/SkRecorder.cpp')
-rw-r--r-- | src/core/SkRecorder.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index c822fdba87..7ffb1f4c44 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -211,6 +211,16 @@ void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, APPEND(DrawImage, this->copy(paint), sk_ref_sp(image), left, top); } +void SkRecorder::onDrawImageLattice(const SkImage* image, + const Lattice& lattice, + const SkRect& dst, + const SkPaint* paint) { + APPEND(DrawImageLattice, this->copy(paint), sk_ref_sp(image), + lattice.fXCount, this->copy(lattice.fXDivs, lattice.fXCount), + lattice.fYCount, this->copy(lattice.fYDivs, lattice.fYCount), dst); +} + + void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint) { APPEND(DrawImageRect, this->copy(paint), sk_ref_sp(image), this->copy(src), dst, constraint); |