OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 void SkCanvas::drawImage(const SkImage* image, SkScalar dx, SkScalar dy, const S
kPaint* paint) { | 1662 void SkCanvas::drawImage(const SkImage* image, SkScalar dx, SkScalar dy, const S
kPaint* paint) { |
1663 this->onDrawImage(image, dx, dy, paint); | 1663 this->onDrawImage(image, dx, dy, paint); |
1664 } | 1664 } |
1665 | 1665 |
1666 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe
ct& dst, | 1666 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe
ct& dst, |
1667 const SkPaint* paint) { | 1667 const SkPaint* paint) { |
1668 this->onDrawImageRect(image, src, dst, paint); | 1668 this->onDrawImageRect(image, src, dst, paint); |
1669 } | 1669 } |
1670 | 1670 |
1671 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons
t SkPaint* paint) { | 1671 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons
t SkPaint* paint) { |
| 1672 if (bitmap.empty()) { |
| 1673 return; |
| 1674 } |
1672 this->onDrawBitmap(bitmap, dx, dy, paint); | 1675 this->onDrawBitmap(bitmap, dx, dy, paint); |
1673 } | 1676 } |
1674 | 1677 |
1675 void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, c
onst SkRect& dst, | 1678 void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, c
onst SkRect& dst, |
1676 const SkPaint* paint, DrawBitmapRectFlags fl
ags) { | 1679 const SkPaint* paint, DrawBitmapRectFlags fl
ags) { |
| 1680 if (bitmap.empty()) { |
| 1681 return; |
| 1682 } |
1677 this->onDrawBitmapRect(bitmap, src, dst, paint, flags); | 1683 this->onDrawBitmapRect(bitmap, src, dst, paint, flags); |
1678 } | 1684 } |
1679 | 1685 |
1680 void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, con
st SkRect& dst, | 1686 void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, con
st SkRect& dst, |
1681 const SkPaint* paint) { | 1687 const SkPaint* paint) { |
| 1688 if (bitmap.empty()) { |
| 1689 return; |
| 1690 } |
1682 this->onDrawBitmapNine(bitmap, center, dst, paint); | 1691 this->onDrawBitmapNine(bitmap, center, dst, paint); |
1683 } | 1692 } |
1684 | 1693 |
1685 void SkCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPai
nt* paint) { | 1694 void SkCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPai
nt* paint) { |
| 1695 if (bitmap.empty()) { |
| 1696 return; |
| 1697 } |
1686 this->onDrawSprite(bitmap, left, top, paint); | 1698 this->onDrawSprite(bitmap, left, top, paint); |
1687 } | 1699 } |
1688 | 1700 |
1689 ////////////////////////////////////////////////////////////////////////////// | 1701 ////////////////////////////////////////////////////////////////////////////// |
1690 // These are the virtual drawing methods | 1702 // These are the virtual drawing methods |
1691 ////////////////////////////////////////////////////////////////////////////// | 1703 ////////////////////////////////////////////////////////////////////////////// |
1692 | 1704 |
1693 void SkCanvas::onDiscard() { | 1705 void SkCanvas::onDiscard() { |
1694 if (fSurfaceBase) { | 1706 if (fSurfaceBase) { |
1695 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode); | 1707 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode); |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2547 } | 2559 } |
2548 | 2560 |
2549 if (matrix) { | 2561 if (matrix) { |
2550 canvas->concat(*matrix); | 2562 canvas->concat(*matrix); |
2551 } | 2563 } |
2552 } | 2564 } |
2553 | 2565 |
2554 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2566 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2555 fCanvas->restoreToCount(fSaveCount); | 2567 fCanvas->restoreToCount(fSaveCount); |
2556 } | 2568 } |
OLD | NEW |