Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: src/core/SkCanvas.cpp

Issue 2203983002: Fix copy-paste bugs in SkCanvas Nine and Lattice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 648059a1965cdbc71c1e6a4eee19931ca6dd9bd1..0b0434dab895963f0132fcbabe7ca99d93b3e8a2 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1985,10 +1985,11 @@ void SkCanvas::drawImageNine(const SkImage* image, const SkIRect& center, const
if (dst.isEmpty()) {
return;
}
- if (!SkLatticeIter::Valid(image->width(), image->height(), center)) {
+ if (SkLatticeIter::Valid(image->width(), image->height(), center)) {
+ this->onDrawImageNine(image, center, dst, paint);
+ } else {
this->drawImageRect(image, dst, paint);
}
- this->onDrawImageNine(image, center, dst, paint);
}
void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, const SkPaint* paint) {
@@ -2022,10 +2023,12 @@ void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, con
if (bitmap.drawsNothing() || dst.isEmpty()) {
return;
}
- if (!SkLatticeIter::Valid(bitmap.width(), bitmap.height(), center)) {
+ if (SkLatticeIter::Valid(bitmap.width(), bitmap.height(), center)) {
+ this->onDrawBitmapNine(bitmap, center, dst, paint);
+ } else {
this->drawBitmapRect(bitmap, dst, paint);
}
- this->onDrawBitmapNine(bitmap, center, dst, paint);
+
}
void SkCanvas::drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst,
@@ -2040,10 +2043,11 @@ void SkCanvas::drawImageLattice(const SkImage* image, const Lattice& lattice, co
if (dst.isEmpty()) {
return;
}
- if (!SkLatticeIter::Valid(image->width(), image->height(), lattice)) {
+ if (SkLatticeIter::Valid(image->width(), image->height(), lattice)) {
+ this->onDrawImageLattice(image, lattice, dst, paint);
+ } else {
this->drawImageRect(image, dst, paint);
}
- this->onDrawImageLattice(image, lattice, dst, paint);
}
void SkCanvas::drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698