diff options
author | msarett <msarett@google.com> | 2016-09-30 12:41:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-30 12:41:42 -0700 |
commit | 71df2d7bc1bbc83ad4cf005f9027df4cb3b88a9b (patch) | |
tree | 9113c13e0d2285f1204e0a4bee8d89eb644d16ed /src/core/SkRecorder.cpp | |
parent | 9c8a32ff4507481aadf1a190637ee8d55c8dc217 (diff) |
Add a src rect to drawImageLattice() API
This will allow us to draw ninepatches directly from an asset
texture without having to upload them individually.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2382893002
Review-Url: https://codereview.chromium.org/2382893002
Diffstat (limited to 'src/core/SkRecorder.cpp')
-rw-r--r-- | src/core/SkRecorder.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index 0c236716bc..08c73700d8 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -239,10 +239,11 @@ void SkRecorder::onDrawImageNine(const SkImage* image, const SkIRect& center, void SkRecorder::onDrawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst, const SkPaint* paint) { int flagCount = lattice.fFlags ? (lattice.fXCount + 1) * (lattice.fYCount + 1) : 0; + SkASSERT(lattice.fBounds); 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), - flagCount, this->copy(lattice.fFlags, flagCount), dst); + flagCount, this->copy(lattice.fFlags, flagCount), *lattice.fBounds, dst); } void SkRecorder::onDrawText(const void* text, size_t byteLength, |