| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 #ifndef SkBitmap_DEFINED | 8 #ifndef SkBitmap_DEFINED |
| 9 #define SkBitmap_DEFINED | 9 #define SkBitmap_DEFINED |
| 10 | 10 |
| 11 #include "SkColor.h" | 11 #include "SkColor.h" |
| 12 #include "SkColorTable.h" | 12 #include "SkColorTable.h" |
| 13 #include "SkImageInfo.h" | 13 #include "SkImageInfo.h" |
| 14 #include "SkPoint.h" | 14 #include "SkPoint.h" |
| 15 #include "SkRefCnt.h" | 15 #include "SkRefCnt.h" |
| 16 | 16 |
| 17 //#define SK_SUPPORT_LEGACY_COPYTO_CONFIG | 17 //#define SK_SUPPORT_LEGACY_COPYTO_CONFIG |
| 18 | 18 |
| 19 //#define SK_SUPPORT_DEEPCOPYTO_CONFIG | |
| 20 | |
| 21 struct SkMask; | 19 struct SkMask; |
| 22 struct SkIRect; | 20 struct SkIRect; |
| 23 struct SkRect; | 21 struct SkRect; |
| 24 class SkPaint; | 22 class SkPaint; |
| 25 class SkPixelRef; | 23 class SkPixelRef; |
| 26 class SkPixelRefFactory; | 24 class SkPixelRefFactory; |
| 27 class SkRegion; | 25 class SkRegion; |
| 28 class SkString; | 26 class SkString; |
| 29 class GrTexture; | 27 class GrTexture; |
| 30 | 28 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 bool copyTo(SkBitmap* dst, Allocator* allocator = NULL) const { | 638 bool copyTo(SkBitmap* dst, Allocator* allocator = NULL) const { |
| 641 return this->copyTo(dst, this->colorType(), allocator); | 639 return this->copyTo(dst, this->colorType(), allocator); |
| 642 } | 640 } |
| 643 | 641 |
| 644 /** | 642 /** |
| 645 * Returns true if this bitmap's pixels can be converted into the requested | 643 * Returns true if this bitmap's pixels can be converted into the requested |
| 646 * colorType, such that copyTo() could succeed. | 644 * colorType, such that copyTo() could succeed. |
| 647 */ | 645 */ |
| 648 bool canCopyTo(SkColorType colorType) const; | 646 bool canCopyTo(SkColorType colorType) const; |
| 649 | 647 |
| 650 /** Makes a deep copy of this bitmap, respecting the requested config, and | |
| 651 * with custom allocation logic that will keep the copied pixels | |
| 652 * in the same domain as the source: If the src pixels are allocated for | |
| 653 * the cpu, then so will the dst. If the src pixels are allocated on the | |
| 654 * gpu (typically as a texture), the it will do the same for the dst. | |
| 655 * If the request cannot be fulfilled, returns false and dst is unmodified. | |
| 656 */ | |
| 657 #ifndef SK_SUPPORT_DEEPCOPYTO_CONFIG | |
| 658 private: | |
| 659 #endif | |
| 660 bool deepCopyTo(SkBitmap* dst, Config c) const; | |
| 661 public: | |
| 662 | |
| 663 /** Makes a deep copy of this bitmap, keeping the copied pixels | 648 /** Makes a deep copy of this bitmap, keeping the copied pixels |
| 664 * in the same domain as the source: If the src pixels are allocated for | 649 * in the same domain as the source: If the src pixels are allocated for |
| 665 * the cpu, then so will the dst. If the src pixels are allocated on the | 650 * the cpu, then so will the dst. If the src pixels are allocated on the |
| 666 * gpu (typically as a texture), the it will do the same for the dst. | 651 * gpu (typically as a texture), the it will do the same for the dst. |
| 667 * If the request cannot be fulfilled, returns false and dst is unmodified. | 652 * If the request cannot be fulfilled, returns false and dst is unmodified. |
| 668 */ | 653 */ |
| 669 bool deepCopyTo(SkBitmap* dst) const; | 654 bool deepCopyTo(SkBitmap* dst) const; |
| 670 | 655 |
| 671 SK_ATTR_DEPRECATED("use setFilterLevel on SkPaint") | 656 SK_ATTR_DEPRECATED("use setFilterLevel on SkPaint") |
| 672 void buildMipMap(bool forceRebuild = false); | 657 void buildMipMap(bool forceRebuild = false); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 } | 924 } |
| 940 | 925 |
| 941 /////////////////////////////////////////////////////////////////////////////// | 926 /////////////////////////////////////////////////////////////////////////////// |
| 942 // | 927 // |
| 943 // Helpers until we can fully deprecate SkBitmap::Config | 928 // Helpers until we can fully deprecate SkBitmap::Config |
| 944 // | 929 // |
| 945 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); | 930 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); |
| 946 extern SkColorType SkBitmapConfigToColorType(SkBitmap::Config); | 931 extern SkColorType SkBitmapConfigToColorType(SkBitmap::Config); |
| 947 | 932 |
| 948 #endif | 933 #endif |
| OLD | NEW |