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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1235393003: guard to remove DrawBitmapRectFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
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 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 } 1765 }
1766 1766
1767 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe ct& dst, 1767 void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe ct& dst,
1768 const SkPaint* paint, SrcRectConstraint constraint) { 1768 const SkPaint* paint, SrcRectConstraint constraint) {
1769 if (dst.isEmpty()) { 1769 if (dst.isEmpty()) {
1770 return; 1770 return;
1771 } 1771 }
1772 this->onDrawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(constra int)); 1772 this->onDrawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(constra int));
1773 } 1773 }
1774 1774
1775 void SkCanvas::drawImageRect(const SkImage* image, const SkIRect& isrc, const Sk Rect& dst,
1776 const SkPaint* paint, SrcRectConstraint constraint) {
1777 SkRect src = SkRect::Make(isrc);
1778 this->drawImageRect(image, &src, dst, paint, constraint);
1779 }
1780
1775 void SkCanvas::drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, 1781 void SkCanvas::drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
1776 const SkPaint* paint) { 1782 const SkPaint* paint) {
1777 if (dst.isEmpty()) { 1783 if (dst.isEmpty()) {
1778 return; 1784 return;
1779 } 1785 }
1780 if (!SkNinePatchIter::Valid(image->width(), image->height(), center)) { 1786 if (!SkNinePatchIter::Valid(image->width(), image->height(), center)) {
1781 this->drawImageRect(image, NULL, dst, paint); 1787 this->drawImageRect(image, NULL, dst, paint);
1782 } 1788 }
1783 this->onDrawImageNine(image, center, dst, paint); 1789 this->onDrawImageNine(image, center, dst, paint);
1784 } 1790 }
1785 1791
1786 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons t SkPaint* paint) { 1792 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons t SkPaint* paint) {
1787 if (bitmap.drawsNothing()) { 1793 if (bitmap.drawsNothing()) {
1788 return; 1794 return;
1789 } 1795 }
1790 this->onDrawBitmap(bitmap, dx, dy, paint); 1796 this->onDrawBitmap(bitmap, dx, dy, paint);
1791 } 1797 }
1792 1798
1799 #ifdef SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE
1793 void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, c onst SkRect& dst, 1800 void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, c onst SkRect& dst,
1794 const SkPaint* paint, DrawBitmapRectFlags fl ags) { 1801 const SkPaint* paint, DrawBitmapRectFlags fl ags) {
1795 if (bitmap.drawsNothing() || dst.isEmpty()) { 1802 if (bitmap.drawsNothing() || dst.isEmpty()) {
1796 return; 1803 return;
1797 } 1804 }
1798 this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE) flags); 1805 this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE) flags);
1799 } 1806 }
1807 #endif
1800 1808
1801 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const S kRect& dst, 1809 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const S kRect& dst,
1802 const SkPaint* paint, SrcRectConstraint constraint ) { 1810 const SkPaint* paint, SrcRectConstraint constraint ) {
1803 if (bitmap.drawsNothing() || dst.isEmpty()) { 1811 if (bitmap.drawsNothing() || dst.isEmpty()) {
1804 return; 1812 return;
1805 } 1813 }
1806 this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE) constraint); 1814 this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE) constraint);
1807 } 1815 }
1808 1816
1817 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst,
1818 const SkPaint* paint, SrcRectConstraint constraint ) {
1819 SkRect src = SkRect::Make(isrc);
1820 this->drawBitmapRect(bitmap, &src, dst, paint, constraint);
1821 }
1822
1809 void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, con st SkRect& dst, 1823 void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, con st SkRect& dst,
1810 const SkPaint* paint) { 1824 const SkPaint* paint) {
1811 if (bitmap.drawsNothing() || dst.isEmpty()) { 1825 if (bitmap.drawsNothing() || dst.isEmpty()) {
1812 return; 1826 return;
1813 } 1827 }
1814 if (!SkNinePatchIter::Valid(bitmap.width(), bitmap.height(), center)) { 1828 if (!SkNinePatchIter::Valid(bitmap.width(), bitmap.height(), center)) {
1815 this->drawBitmapRect(bitmap, dst, paint); 1829 this->drawBitmapRect(bitmap, dst, paint);
1816 } 1830 }
1817 this->onDrawBitmapNine(bitmap, center, dst, paint); 1831 this->onDrawBitmapNine(bitmap, center, dst, paint);
1818 } 1832 }
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 } 2783 }
2770 2784
2771 if (matrix) { 2785 if (matrix) {
2772 canvas->concat(*matrix); 2786 canvas->concat(*matrix);
2773 } 2787 }
2774 } 2788 }
2775 2789
2776 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2790 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2777 fCanvas->restoreToCount(fSaveCount); 2791 fCanvas->restoreToCount(fSaveCount);
2778 } 2792 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698