Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/core/SkBitmap.cpp

Issue 147213002: add optional SkAlphaType parameter to notifyPixelsChanged (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix dox Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkPixelRef.h ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 bool SkBitmap::setConfig(const SkImageInfo& info, size_t rowBytes) { 315 bool SkBitmap::setConfig(const SkImageInfo& info, size_t rowBytes) {
316 return this->setConfig(SkImageInfoToBitmapConfig(info), info.fWidth, 316 return this->setConfig(SkImageInfoToBitmapConfig(info), info.fWidth,
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 fAlphaType = SkToU8(alphaType); 324 if (fAlphaType != alphaType) {
325 fAlphaType = SkToU8(alphaType);
326 if (fPixelRef) {
327 fPixelRef->notifyPixelsChanged(alphaType);
328 }
329 }
325 return true; 330 return true;
326 } 331 }
327 332
328 void SkBitmap::updatePixelsFromRef() const { 333 void SkBitmap::updatePixelsFromRef() const {
329 if (NULL != fPixelRef) { 334 if (NULL != fPixelRef) {
330 if (fPixelLockCount > 0) { 335 if (fPixelLockCount > 0) {
331 SkASSERT(fPixelRef->isLocked()); 336 SkASSERT(fPixelRef->isLocked());
332 337
333 void* p = fPixelRef->pixels(); 338 void* p = fPixelRef->pixels();
334 if (NULL != p) { 339 if (NULL != p) {
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 if (NULL != uri) { 1725 if (NULL != uri) {
1721 str->appendf(" uri:\"%s\"", uri); 1726 str->appendf(" uri:\"%s\"", uri);
1722 } else { 1727 } else {
1723 str->appendf(" pixelref:%p", pr); 1728 str->appendf(" pixelref:%p", pr);
1724 } 1729 }
1725 } 1730 }
1726 1731
1727 str->append(")"); 1732 str->append(")");
1728 } 1733 }
1729 #endif 1734 #endif
OLDNEW
« no previous file with comments | « include/core/SkPixelRef.h ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698