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 |
8 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
9 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
10 #include "SkDeviceImageFilterProxy.h" | 11 #include "SkDeviceImageFilterProxy.h" |
11 #include "SkDraw.h" | 12 #include "SkDraw.h" |
12 #include "SkDrawFilter.h" | 13 #include "SkDrawFilter.h" |
13 #include "SkDrawLooper.h" | 14 #include "SkDrawLooper.h" |
14 #include "SkMetaData.h" | 15 #include "SkMetaData.h" |
15 #include "SkPathOps.h" | 16 #include "SkPathOps.h" |
16 #include "SkPicture.h" | 17 #include "SkPicture.h" |
17 #include "SkRasterClip.h" | 18 #include "SkRasterClip.h" |
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 if (fMCRec->fRasterClip->isEmpty()) { | 1766 if (fMCRec->fRasterClip->isEmpty()) { |
1766 return kEmpty_ClipType; | 1767 return kEmpty_ClipType; |
1767 } | 1768 } |
1768 if (fMCRec->fRasterClip->isRect()) { | 1769 if (fMCRec->fRasterClip->isRect()) { |
1769 return kRect_ClipType; | 1770 return kRect_ClipType; |
1770 } | 1771 } |
1771 return kComplex_ClipType; | 1772 return kComplex_ClipType; |
1772 } | 1773 } |
1773 #endif | 1774 #endif |
1774 | 1775 |
| 1776 #ifdef SK_SUPPORT_LEGACY_GETTOTALCLIP |
| 1777 const SkRegion& SkCanvas::getTotalClip() const { |
| 1778 return fMCRec->fRasterClip->forceGetBW(); |
| 1779 } |
| 1780 #endif |
| 1781 |
1775 const SkRegion& SkCanvas::internal_private_getTotalClip() const { | 1782 const SkRegion& SkCanvas::internal_private_getTotalClip() const { |
1776 return fMCRec->fRasterClip->forceGetBW(); | 1783 return fMCRec->fRasterClip->forceGetBW(); |
1777 } | 1784 } |
1778 | 1785 |
1779 void SkCanvas::internal_private_getTotalClipAsPath(SkPath* path) const { | 1786 void SkCanvas::internal_private_getTotalClipAsPath(SkPath* path) const { |
1780 path->reset(); | 1787 path->reset(); |
1781 | 1788 |
1782 const SkRegion& rgn = fMCRec->fRasterClip->forceGetBW(); | 1789 const SkRegion& rgn = fMCRec->fRasterClip->forceGetBW(); |
1783 if (rgn.isEmpty()) { | 1790 if (rgn.isEmpty()) { |
1784 return; | 1791 return; |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 if (!supported_for_raster_canvas(info)) { | 2588 if (!supported_for_raster_canvas(info)) { |
2582 return NULL; | 2589 return NULL; |
2583 } | 2590 } |
2584 | 2591 |
2585 SkBitmap bitmap; | 2592 SkBitmap bitmap; |
2586 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2593 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2587 return NULL; | 2594 return NULL; |
2588 } | 2595 } |
2589 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2596 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2590 } | 2597 } |
OLD | NEW |