Chromium Code Reviews| 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 |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 * will be used. | 584 * will be used. |
| 585 * @return true if the copy was made. | 585 * @return true if the copy was made. |
| 586 */ | 586 */ |
| 587 bool copyTo(SkBitmap* dst, SkColorType ct, Allocator* = NULL) const; | 587 bool copyTo(SkBitmap* dst, SkColorType ct, Allocator* = NULL) const; |
| 588 | 588 |
| 589 bool copyTo(SkBitmap* dst, Allocator* allocator = NULL) const { | 589 bool copyTo(SkBitmap* dst, Allocator* allocator = NULL) const { |
| 590 return this->copyTo(dst, this->colorType(), allocator); | 590 return this->copyTo(dst, this->colorType(), allocator); |
| 591 } | 591 } |
| 592 | 592 |
| 593 /** | 593 /** |
| 594 * Copy the bitmap's pixels into the specified buffer (pixels + rowBytes), | |
| 595 * converting them into the requested format (SkImageInfo). The src pixels are read | |
| 596 * starting at the specified (x,y) offset, relative to the top-left corner. | |
| 597 * | |
| 598 * The specified ImageInfo and (x,y) offset specifies a source rectangle | |
| 599 * | |
| 600 * srcR.setXYWH(x, y, info.width(), info.height()); | |
| 601 * | |
| 602 * SrcR is intersected with the bounds of the bitmap. If this intersection is not empty, | |
| 603 * then we have two sets of pixels (of equal size), the "src" beginning at (x,y) | |
| 604 * and the "dst" by info+pixels+rowBytes. Replace the dst pixels with the c orresponding src | |
| 605 * pixels, performing any colortype/alphatype transformations needed (in th e case where the | |
| 606 * src and dst have different colortypes or alphatypes). | |
| 607 * | |
| 608 * This call can fail, returning false, for several reasons: | |
| 609 * - If the requested colortype/alphatype cannot be converted from the src' s types. | |
| 610 * - If the src pixels are not available. | |
| 611 */ | |
| 612 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in t y) const; | |
|
scroggo
2014/07/09 15:22:02
I take it the intent to perform the work done in c
reed1
2014/07/10 14:10:40
This function is intended to be a mirror of canvas
| |
| 613 | |
| 614 /** | |
| 594 * Returns true if this bitmap's pixels can be converted into the requested | 615 * Returns true if this bitmap's pixels can be converted into the requested |
| 595 * colorType, such that copyTo() could succeed. | 616 * colorType, such that copyTo() could succeed. |
| 596 */ | 617 */ |
| 597 bool canCopyTo(SkColorType colorType) const; | 618 bool canCopyTo(SkColorType colorType) const; |
| 598 | 619 |
| 599 /** Makes a deep copy of this bitmap, keeping the copied pixels | 620 /** Makes a deep copy of this bitmap, keeping the copied pixels |
| 600 * in the same domain as the source: If the src pixels are allocated for | 621 * in the same domain as the source: If the src pixels are allocated for |
| 601 * the cpu, then so will the dst. If the src pixels are allocated on the | 622 * the cpu, then so will the dst. If the src pixels are allocated on the |
| 602 * gpu (typically as a texture), the it will do the same for the dst. | 623 * gpu (typically as a texture), the it will do the same for the dst. |
| 603 * If the request cannot be fulfilled, returns false and dst is unmodified. | 624 * If the request cannot be fulfilled, returns false and dst is unmodified. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 #ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG | 869 #ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG |
| 849 /////////////////////////////////////////////////////////////////////////////// | 870 /////////////////////////////////////////////////////////////////////////////// |
| 850 // | 871 // |
| 851 // Helpers until we can fully deprecate SkBitmap::Config | 872 // Helpers until we can fully deprecate SkBitmap::Config |
| 852 // | 873 // |
| 853 SK_API SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); | 874 SK_API SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); |
| 854 SK_API SkColorType SkBitmapConfigToColorType(SkBitmap::Config); | 875 SK_API SkColorType SkBitmapConfigToColorType(SkBitmap::Config); |
| 855 #endif | 876 #endif |
| 856 | 877 |
| 857 #endif | 878 #endif |
| OLD | NEW |