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 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 } | 1887 } |
1888 | 1888 |
1889 void SkCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top, | 1889 void SkCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top, |
1890 const SkPaint* paint) { | 1890 const SkPaint* paint) { |
1891 image->draw(this, left, top, paint); | 1891 image->draw(this, left, top, paint); |
1892 } | 1892 } |
1893 | 1893 |
1894 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, | 1894 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, |
1895 const SkRect& dst, | 1895 const SkRect& dst, |
1896 const SkPaint* paint) { | 1896 const SkPaint* paint) { |
1897 image->draw(this, src, dst, paint); | 1897 image->drawRect(this, src, dst, paint); |
1898 } | 1898 } |
1899 | 1899 |
1900 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, | 1900 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
1901 const SkPaint* paint) { | 1901 const SkPaint* paint) { |
1902 SkDEBUGCODE(bitmap.validate();) | 1902 SkDEBUGCODE(bitmap.validate();) |
1903 | 1903 |
1904 if (NULL == paint || paint->canComputeFastBounds()) { | 1904 if (NULL == paint || paint->canComputeFastBounds()) { |
1905 SkRect bounds = { | 1905 SkRect bounds = { |
1906 x, y, | 1906 x, y, |
1907 x + SkIntToScalar(bitmap.width()), | 1907 x + SkIntToScalar(bitmap.width()), |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 } | 2548 } |
2549 | 2549 |
2550 if (matrix) { | 2550 if (matrix) { |
2551 canvas->concat(*matrix); | 2551 canvas->concat(*matrix); |
2552 } | 2552 } |
2553 } | 2553 } |
2554 | 2554 |
2555 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2555 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2556 fCanvas->restoreToCount(fSaveCount); | 2556 fCanvas->restoreToCount(fSaveCount); |
2557 } | 2557 } |
OLD | NEW |