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

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

Issue 137263009: change setAlphaType to not modify the pixelref's genID (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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