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 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1623 case SERIALIZE_PIXELTYPE_NONE: | 1623 case SERIALIZE_PIXELTYPE_NONE: |
1624 break; | 1624 break; |
1625 default: | 1625 default: |
1626 SkDEBUGFAIL("unrecognized pixeltype in serialized data"); | 1626 SkDEBUGFAIL("unrecognized pixeltype in serialized data"); |
1627 sk_throw(); | 1627 sk_throw(); |
1628 } | 1628 } |
1629 } | 1629 } |
1630 | 1630 |
1631 /////////////////////////////////////////////////////////////////////////////// | 1631 /////////////////////////////////////////////////////////////////////////////// |
1632 | 1632 |
1633 SkBitmap::RLEPixels::RLEPixels(int width, int height) { | 1633 SkBitmap::RLEPixels::RLEPixels(int width, int height) { |
scroggo
2013/10/09 18:56:11
Does anyone use RLEPixels? Wasn't it for a config
mtklein
2013/10/09 19:07:18
No idea. Got to admit I did this change entirely
| |
1634 fHeight = height; | 1634 fHeight = height; |
1635 fYPtrs = (uint8_t**)sk_malloc_throw(height * sizeof(uint8_t*)); | 1635 fYPtrs = (uint8_t**)sk_calloc_throw(height * sizeof(uint8_t*)); |
1636 sk_bzero(fYPtrs, height * sizeof(uint8_t*)); | |
1637 } | 1636 } |
1638 | 1637 |
1639 SkBitmap::RLEPixels::~RLEPixels() { | 1638 SkBitmap::RLEPixels::~RLEPixels() { |
1640 sk_free(fYPtrs); | 1639 sk_free(fYPtrs); |
1641 } | 1640 } |
1642 | 1641 |
1643 /////////////////////////////////////////////////////////////////////////////// | 1642 /////////////////////////////////////////////////////////////////////////////// |
1644 | 1643 |
1645 #ifdef SK_DEBUG | 1644 #ifdef SK_DEBUG |
1646 void SkBitmap::validate() const { | 1645 void SkBitmap::validate() const { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1700 if (NULL != uri) { | 1699 if (NULL != uri) { |
1701 str->appendf(" uri:\"%s\"", uri); | 1700 str->appendf(" uri:\"%s\"", uri); |
1702 } else { | 1701 } else { |
1703 str->appendf(" pixelref:%p", pr); | 1702 str->appendf(" pixelref:%p", pr); |
1704 } | 1703 } |
1705 } | 1704 } |
1706 | 1705 |
1707 str->append(")"); | 1706 str->append(")"); |
1708 } | 1707 } |
1709 #endif | 1708 #endif |
OLD | NEW |