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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 info.fHeight, rowBytes, info.fAlphaType); | 317 info.fHeight, rowBytes, info.fAlphaType); |
318 } | 318 } |
319 | 319 |
320 bool SkBitmap::setAlphaType(SkAlphaType alphaType) { | 320 bool SkBitmap::setAlphaType(SkAlphaType alphaType) { |
321 if (!validate_alphaType(this->config(), alphaType, &alphaType)) { | 321 if (!validate_alphaType(this->config(), alphaType, &alphaType)) { |
322 return false; | 322 return false; |
323 } | 323 } |
324 if (fAlphaType != alphaType) { | 324 if (fAlphaType != alphaType) { |
325 fAlphaType = SkToU8(alphaType); | 325 fAlphaType = SkToU8(alphaType); |
326 if (fPixelRef) { | 326 if (fPixelRef) { |
327 fPixelRef->notifyPixelsChanged(alphaType); | 327 fPixelRef->changeAlphaType(alphaType); |
328 } | 328 } |
329 } | 329 } |
330 return true; | 330 return true; |
331 } | 331 } |
332 | 332 |
333 void SkBitmap::updatePixelsFromRef() const { | 333 void SkBitmap::updatePixelsFromRef() const { |
334 if (NULL != fPixelRef) { | 334 if (NULL != fPixelRef) { |
335 if (fPixelLockCount > 0) { | 335 if (fPixelLockCount > 0) { |
336 SkASSERT(fPixelRef->isLocked()); | 336 SkASSERT(fPixelRef->isLocked()); |
337 | 337 |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 if (NULL != uri) { | 1725 if (NULL != uri) { |
1726 str->appendf(" uri:\"%s\"", uri); | 1726 str->appendf(" uri:\"%s\"", uri); |
1727 } else { | 1727 } else { |
1728 str->appendf(" pixelref:%p", pr); | 1728 str->appendf(" pixelref:%p", pr); |
1729 } | 1729 } |
1730 } | 1730 } |
1731 | 1731 |
1732 str->append(")"); | 1732 str->append(")"); |
1733 } | 1733 } |
1734 #endif | 1734 #endif |
OLD | NEW |