| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 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 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 case kAlpha_8_SkColorType: { | 697 case kAlpha_8_SkColorType: { |
| 698 uint8_t* p = this->getAddr8(area.fLeft, area.fTop); | 698 uint8_t* p = this->getAddr8(area.fLeft, area.fTop); |
| 699 while (--height >= 0) { | 699 while (--height >= 0) { |
| 700 memset(p, a, width); | 700 memset(p, a, width); |
| 701 p += rowBytes; | 701 p += rowBytes; |
| 702 } | 702 } |
| 703 break; | 703 break; |
| 704 } | 704 } |
| 705 case kARGB_4444_SkColorType: | 705 case kARGB_4444_SkColorType: |
| 706 case kRGB_565_SkColorType: { | 706 case kRGB_565_SkColorType: { |
| 707 uint16_t* p = this->getAddr16(area.fLeft, area.fTop);; | 707 uint16_t* p = this->getAddr16(area.fLeft, area.fTop); |
| 708 uint16_t v; | 708 uint16_t v; |
| 709 | 709 |
| 710 // make rgb premultiplied | 710 // make rgb premultiplied |
| 711 if (255 != a) { | 711 if (255 != a) { |
| 712 r = SkAlphaMul(r, a); | 712 r = SkAlphaMul(r, a); |
| 713 g = SkAlphaMul(g, a); | 713 g = SkAlphaMul(g, a); |
| 714 b = SkAlphaMul(b, a); | 714 b = SkAlphaMul(b, a); |
| 715 } | 715 } |
| 716 | 716 |
| 717 if (kARGB_4444_SkColorType == this->colorType()) { | 717 if (kARGB_4444_SkColorType == this->colorType()) { |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 /////////////////////////////////////////////////////////////////////////////// | 1365 /////////////////////////////////////////////////////////////////////////////// |
| 1366 | 1366 |
| 1367 #ifdef SK_DEBUG | 1367 #ifdef SK_DEBUG |
| 1368 void SkImageInfo::validate() const { | 1368 void SkImageInfo::validate() const { |
| 1369 SkASSERT(fWidth >= 0); | 1369 SkASSERT(fWidth >= 0); |
| 1370 SkASSERT(fHeight >= 0); | 1370 SkASSERT(fHeight >= 0); |
| 1371 SkASSERT(SkColorTypeIsValid(fColorType)); | 1371 SkASSERT(SkColorTypeIsValid(fColorType)); |
| 1372 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1372 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
| 1373 } | 1373 } |
| 1374 #endif | 1374 #endif |
| OLD | NEW |