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

Side by Side Diff: src/core/SkPixelRef.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, 11 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 | « src/core/SkBitmap.cpp ('k') | no next file » | 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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkPixelRef.h" 8 #include "SkPixelRef.h"
9 #include "SkFlattenableBuffers.h" 9 #include "SkFlattenableBuffers.h"
10 #include "SkThread.h" 10 #include "SkThread.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // We don't invalidate ourselves if we think another SkPixelRef is sharing o ur genID. 247 // We don't invalidate ourselves if we think another SkPixelRef is sharing o ur genID.
248 if (fUniqueGenerationID) { 248 if (fUniqueGenerationID) {
249 for (int i = 0; i < fGenIDChangeListeners.count(); i++) { 249 for (int i = 0; i < fGenIDChangeListeners.count(); i++) {
250 fGenIDChangeListeners[i]->onChange(); 250 fGenIDChangeListeners[i]->onChange();
251 } 251 }
252 } 252 }
253 // Listeners get at most one shot, so whether these triggered or not, blow t hem away. 253 // Listeners get at most one shot, so whether these triggered or not, blow t hem away.
254 fGenIDChangeListeners.deleteAll(); 254 fGenIDChangeListeners.deleteAll();
255 } 255 }
256 256
257 void SkPixelRef::notifyPixelsChanged() { 257 void SkPixelRef::notifyPixelsChanged(SkAlphaType at) {
258 #ifdef SK_DEBUG 258 #ifdef SK_DEBUG
259 if (fIsImmutable) { 259 if (fIsImmutable) {
260 SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); 260 SkDebugf("========== notifyPixelsChanged called on immutable pixelref");
261 } 261 }
262 #endif 262 #endif
263 *const_cast<SkAlphaType*>(&fInfo.fAlphaType) = at;
263 this->callGenIDChangeListeners(); 264 this->callGenIDChangeListeners();
264 this->needsNewGenID(); 265 this->needsNewGenID();
265 } 266 }
266 267
267 void SkPixelRef::setImmutable() { 268 void SkPixelRef::setImmutable() {
268 fIsImmutable = true; 269 fIsImmutable = true;
269 } 270 }
270 271
271 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { 272 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) {
272 return this->onReadPixels(dst, subset); 273 return this->onReadPixels(dst, subset);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 312
312 #ifdef SK_BUILD_FOR_ANDROID 313 #ifdef SK_BUILD_FOR_ANDROID
313 void SkPixelRef::globalRef(void* data) { 314 void SkPixelRef::globalRef(void* data) {
314 this->ref(); 315 this->ref();
315 } 316 }
316 317
317 void SkPixelRef::globalUnref() { 318 void SkPixelRef::globalUnref() {
318 this->unref(); 319 this->unref();
319 } 320 }
320 #endif 321 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698