diff options
author | 2015-12-07 12:51:30 -0800 | |
---|---|---|
committer | 2015-12-07 12:51:30 -0800 | |
commit | c41e7e14f4a0076d277870502168ed870e558dfc (patch) | |
tree | 3c1195e9a3fd8c53b862139c0c3103cf5ed24100 /src/core | |
parent | 6b28017781b47ebd9c9c3f3a52561f05702d5e8a (diff) |
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
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 88dddf412a..3880fa9d73 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()); |