Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBitmap_DEFINED | 10 #ifndef SkBitmap_DEFINED |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 } | 401 } |
| 402 /** Initialize the bitmap's pixels with the specified color, automatically c onverting into the correct format | 402 /** Initialize the bitmap's pixels with the specified color, automatically c onverting into the correct format |
| 403 for the bitmap's config. If the config is kRGB_565_Config, then the colo r's alpha value is presumed | 403 for the bitmap's config. If the config is kRGB_565_Config, then the colo r's alpha value is presumed |
| 404 to be 0xFF. If the config is kA8_Config, then only the color's alpha val ue is used. | 404 to be 0xFF. If the config is kA8_Config, then only the color's alpha val ue is used. |
| 405 */ | 405 */ |
| 406 void eraseColor(SkColor c) const { | 406 void eraseColor(SkColor c) const { |
| 407 this->eraseARGB(SkColorGetA(c), SkColorGetR(c), SkColorGetG(c), | 407 this->eraseARGB(SkColorGetA(c), SkColorGetR(c), SkColorGetG(c), |
| 408 SkColorGetB(c)); | 408 SkColorGetB(c)); |
| 409 } | 409 } |
| 410 | 410 |
| 411 void eraseArea(const SkIRect& area, SkColor c) const; | |
|
scroggo
2013/06/28 19:02:35
Documentation?
reed1
2013/06/28 19:31:54
Done.
| |
| 412 | |
| 411 /** Scroll (a subset of) the contents of this bitmap by dx/dy. If there are | 413 /** Scroll (a subset of) the contents of this bitmap by dx/dy. If there are |
| 412 no pixels allocated (i.e. getPixels() returns null) the method will | 414 no pixels allocated (i.e. getPixels() returns null) the method will |
| 413 still update the inval region (if present). If the bitmap is immutable, | 415 still update the inval region (if present). If the bitmap is immutable, |
| 414 do nothing and return false. | 416 do nothing and return false. |
| 415 | 417 |
| 416 @param subset The subset of the bitmap to scroll/move. To scroll the | 418 @param subset The subset of the bitmap to scroll/move. To scroll the |
| 417 entire contents, specify [0, 0, width, height] or just | 419 entire contents, specify [0, 0, width, height] or just |
| 418 pass null. | 420 pass null. |
| 419 @param dx The amount to scroll in X | 421 @param dx The amount to scroll in X |
| 420 @param dy The amount to scroll in Y | 422 @param dy The amount to scroll in Y |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 #endif | 660 #endif |
| 659 }; | 661 }; |
| 660 | 662 |
| 661 uint32_t fRowBytes; | 663 uint32_t fRowBytes; |
| 662 uint32_t fWidth; | 664 uint32_t fWidth; |
| 663 uint32_t fHeight; | 665 uint32_t fHeight; |
| 664 uint8_t fConfig; | 666 uint8_t fConfig; |
| 665 uint8_t fFlags; | 667 uint8_t fFlags; |
| 666 uint8_t fBytesPerPixel; // based on config | 668 uint8_t fBytesPerPixel; // based on config |
| 667 | 669 |
| 670 void internalErase(const SkIRect&, U8CPU a, U8CPU r, U8CPU g, U8CPU b)const; | |
| 671 | |
| 668 /* Internal computations for safe size. | 672 /* Internal computations for safe size. |
| 669 */ | 673 */ |
| 670 static Sk64 ComputeSafeSize64(Config config, | 674 static Sk64 ComputeSafeSize64(Config config, |
| 671 uint32_t width, | 675 uint32_t width, |
| 672 uint32_t height, | 676 uint32_t height, |
| 673 size_t rowBytes); | 677 size_t rowBytes); |
| 674 static size_t ComputeSafeSize(Config config, | 678 static size_t ComputeSafeSize(Config config, |
| 675 uint32_t width, | 679 uint32_t width, |
| 676 uint32_t height, | 680 uint32_t height, |
| 677 size_t rowBytes); | 681 size_t rowBytes); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 | 803 |
| 800 // returns the address of the byte that contains the x coordinate | 804 // returns the address of the byte that contains the x coordinate |
| 801 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { | 805 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { |
| 802 SkASSERT(fPixels); | 806 SkASSERT(fPixels); |
| 803 SkASSERT(fConfig == kA1_Config); | 807 SkASSERT(fConfig == kA1_Config); |
| 804 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); | 808 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); |
| 805 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); | 809 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); |
| 806 } | 810 } |
| 807 | 811 |
| 808 #endif | 812 #endif |
| OLD | NEW |