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

Unified Diff: src/core/SkCanvas.cpp

Issue 1072033002: Avoid sending empty bitmaps through proxy canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: After discussion moved to SkCanvas Created 5 years, 8 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 63a9241f60ec950f3d8bbed87e9aaa3b045b31de..7949cb3be14cf2c901262a3df8fffdce52e05633 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1669,20 +1669,32 @@ void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe
}
void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, const SkPaint* paint) {
+ if (bitmap.empty()) {
+ return;
+ }
this->onDrawBitmap(bitmap, dx, dy, paint);
}
void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
+ if (bitmap.empty()) {
+ return;
+ }
this->onDrawBitmapRect(bitmap, src, dst, paint, flags);
}
void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
+ if (bitmap.empty()) {
+ return;
+ }
this->onDrawBitmapNine(bitmap, center, dst, paint);
}
void SkCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
+ if (bitmap.empty()) {
+ return;
+ }
this->onDrawSprite(bitmap, left, top, paint);
}
« 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