Minor code cleanups in SkCanvas.
Since the SK_SAVE_LAYER_BOUNDS_ARE_FILTERED path is long gone from
SkCanvas, remove or localize some temporary variables.
Cleanup only; no user-visible changes.
BUG=skia:
Review URL: https://codereview.chromium.org/1508823002
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 88dddf4..3880fa9 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2257,10 +2257,8 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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());