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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 535 bool hasMipMap() const; | 535 bool hasMipMap() const; |
| 536 void buildMipMap(bool forceRebuild = false); | 536 void buildMipMap(bool forceRebuild = false); |
| 537 void freeMipMap(); | 537 void freeMipMap(); |
| 538 | 538 |
| 539 /** Given scale factors sx, sy, determine the miplevel available in the | 539 /** Given scale factors sx, sy, determine the miplevel available in the |
| 540 bitmap, and return it (this is the amount to shift matrix iterators | 540 bitmap, and return it (this is the amount to shift matrix iterators |
| 541 by). If dst is not null, it is set to the correct level. | 541 by). If dst is not null, it is set to the correct level. |
| 542 */ | 542 */ |
| 543 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); | 543 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); |
| 544 | 544 |
| 545 #ifdef SK_BUILD_FOR_ANDROID | |
| 546 bool hasHardwareMipMap() const { | |
| 547 return fHasHardwareMipMap; | |
| 548 } | |
| 549 | |
|
reed1
2013/03/08 16:00:39
A comment about what the heck this is would be nic
djsollen
2013/03/08 16:25:39
Done.
| |
| 550 void setHasHardwareMipMap(bool hasHardwareMipMap) { | |
| 551 fHasHardwareMipMap = hasHardwareMipMap; | |
| 552 } | |
| 553 #endif | |
| 554 | |
| 545 bool extractAlpha(SkBitmap* dst) const { | 555 bool extractAlpha(SkBitmap* dst) const { |
| 546 return this->extractAlpha(dst, NULL, NULL, NULL); | 556 return this->extractAlpha(dst, NULL, NULL, NULL); |
| 547 } | 557 } |
| 548 | 558 |
| 549 bool extractAlpha(SkBitmap* dst, const SkPaint* paint, | 559 bool extractAlpha(SkBitmap* dst, const SkPaint* paint, |
| 550 SkIPoint* offset) const { | 560 SkIPoint* offset) const { |
| 551 return this->extractAlpha(dst, paint, NULL, offset); | 561 return this->extractAlpha(dst, paint, NULL, offset); |
| 552 } | 562 } |
| 553 | 563 |
| 554 /** Set dst to contain alpha layer of this bitmap. If destination bitmap | 564 /** Set dst to contain alpha layer of this bitmap. If destination bitmap |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 kImageIsImmutable_Flag = 0x04 | 655 kImageIsImmutable_Flag = 0x04 |
| 646 }; | 656 }; |
| 647 | 657 |
| 648 uint32_t fRowBytes; | 658 uint32_t fRowBytes; |
| 649 uint32_t fWidth; | 659 uint32_t fWidth; |
| 650 uint32_t fHeight; | 660 uint32_t fHeight; |
| 651 uint8_t fConfig; | 661 uint8_t fConfig; |
| 652 uint8_t fFlags; | 662 uint8_t fFlags; |
| 653 uint8_t fBytesPerPixel; // based on config | 663 uint8_t fBytesPerPixel; // based on config |
| 654 | 664 |
| 665 #ifdef SK_BUILD_FOR_ANDROID | |
|
reed1
2013/03/08 16:00:39
Can this just be an added bit to Flags, so we don'
djsollen
2013/03/08 16:25:39
Done.
| |
| 666 bool fHasHardwareMipMap; | |
| 667 #endif | |
| 668 | |
| 655 /* Internal computations for safe size. | 669 /* Internal computations for safe size. |
| 656 */ | 670 */ |
| 657 static Sk64 ComputeSafeSize64(Config config, | 671 static Sk64 ComputeSafeSize64(Config config, |
| 658 uint32_t width, | 672 uint32_t width, |
| 659 uint32_t height, | 673 uint32_t height, |
| 660 size_t rowBytes); | 674 size_t rowBytes); |
| 661 static size_t ComputeSafeSize(Config config, | 675 static size_t ComputeSafeSize(Config config, |
| 662 uint32_t width, | 676 uint32_t width, |
| 663 uint32_t height, | 677 uint32_t height, |
| 664 size_t rowBytes); | 678 size_t rowBytes); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 776 | 790 |
| 777 // returns the address of the byte that contains the x coordinate | 791 // returns the address of the byte that contains the x coordinate |
| 778 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { | 792 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { |
| 779 SkASSERT(fPixels); | 793 SkASSERT(fPixels); |
| 780 SkASSERT(fConfig == kA1_Config); | 794 SkASSERT(fConfig == kA1_Config); |
| 781 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); | 795 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); |
| 782 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); | 796 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); |
| 783 } | 797 } |
| 784 | 798 |
| 785 #endif | 799 #endif |
| OLD | NEW |