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

Unified Diff: src/core/SkCanvas.cpp

Issue 1508823002: Minor code cleanups in SkCanvas. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 88dddf412a7ae663c1e34d343a8ddd953f8ca1dc..3880fa9d733f1cd843a67829ca7099b63d585d87 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2257,10 +2257,8 @@ void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const S
void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint, SrcRectConstraint constraint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageRect()");
- SkRect storage;
- const SkRect* bounds = &dst;
if (nullptr == paint || paint->canComputeFastBounds()) {
- storage = dst;
+ SkRect storage = dst;
if (paint) {
paint->computeFastBounds(dst, &storage);
}
@@ -2273,7 +2271,7 @@ void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const Sk
paint = lazy.init();
}
- LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(*paint, SkDrawFilter::kBitmap_Type, bounds,
+ LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(*paint, SkDrawFilter::kBitmap_Type, &dst,
image->isOpaque())
while (iter.next()) {
@@ -2338,9 +2336,8 @@ void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
return;
}
- SkRect storage;
- const SkRect* bounds = &dst;
if (nullptr == paint || paint->canComputeFastBounds()) {
+ SkRect storage;
if (this->quickReject(paint ? paint->computeFastBounds(dst, &storage) : dst)) {
return;
}
@@ -2351,7 +2348,7 @@ void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
paint = lazy.init();
}
- LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(*paint, SkDrawFilter::kBitmap_Type, bounds,
+ LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(*paint, SkDrawFilter::kBitmap_Type, &dst,
bitmap.isOpaque())
while (iter.next()) {
@@ -2372,9 +2369,8 @@ void SkCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, cons
const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageNine()");
- SkRect storage;
- const SkRect* bounds = &dst;
if (nullptr == paint || paint->canComputeFastBounds()) {
+ SkRect storage;
if (this->quickReject(paint ? paint->computeFastBounds(dst, &storage) : dst)) {
return;
}
@@ -2385,7 +2381,7 @@ void SkCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, cons
paint = lazy.init();
}
- LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, bounds)
+ LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, &dst)
while (iter.next()) {
iter.fDevice->drawImageNine(iter, image, center, dst, looper.paint());
@@ -2399,9 +2395,8 @@ void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, c
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmapNine()");
SkDEBUGCODE(bitmap.validate();)
- SkRect storage;
- const SkRect* bounds = &dst;
if (nullptr == paint || paint->canComputeFastBounds()) {
+ SkRect storage;
if (this->quickReject(paint ? paint->computeFastBounds(dst, &storage) : dst)) {
return;
}
@@ -2412,7 +2407,7 @@ void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, c
paint = lazy.init();
}
- LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, bounds)
+ LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, &dst)
while (iter.next()) {
iter.fDevice->drawBitmapNine(iter, bitmap, center, dst, looper.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