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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkRWBuffer.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapCache.h" 8 #include "SkBitmapCache.h"
9 #include "SkMutex.h" 9 #include "SkMutex.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 // We can't quite SkASSERT(this->genIDIsUnique()). It could be non-uniqu e 237 // We can't quite SkASSERT(this->genIDIsUnique()). It could be non-uniqu e
238 // if we got here via the else path (pretty unlikely, but possible). 238 // if we got here via the else path (pretty unlikely, but possible).
239 } 239 }
240 return id & ~1u; // Mask off bottom unique bit. 240 return id & ~1u; // Mask off bottom unique bit.
241 } 241 }
242 242
243 void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) { 243 void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) {
244 if (NULL == listener || !this->genIDIsUnique()) { 244 if (NULL == listener || !this->genIDIsUnique()) {
245 // No point in tracking this if we're not going to call it. 245 // No point in tracking this if we're not going to call it.
246 SkDELETE(listener); 246 delete listener;
247 return; 247 return;
248 } 248 }
249 *fGenIDChangeListeners.append() = listener; 249 *fGenIDChangeListeners.append() = listener;
250 } 250 }
251 251
252 // we need to be called *before* the genID gets changed or zerod 252 // we need to be called *before* the genID gets changed or zerod
253 void SkPixelRef::callGenIDChangeListeners() { 253 void SkPixelRef::callGenIDChangeListeners() {
254 // We don't invalidate ourselves if we think another SkPixelRef is sharing o ur genID. 254 // We don't invalidate ourselves if we think another SkPixelRef is sharing o ur genID.
255 if (this->genIDIsUnique()) { 255 if (this->genIDIsUnique()) {
256 for (int i = 0; i < fGenIDChangeListeners.count(); i++) { 256 for (int i = 0; i < fGenIDChangeListeners.count(); i++) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 result->fUnlockProc = unlock_legacy_result; 346 result->fUnlockProc = unlock_legacy_result;
347 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr oc 347 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr oc
348 result->fCTable = fRec.fColorTable; 348 result->fCTable = fRec.fColorTable;
349 result->fPixels = fRec.fPixels; 349 result->fPixels = fRec.fPixels;
350 result->fRowBytes = fRec.fRowBytes; 350 result->fRowBytes = fRec.fRowBytes;
351 result->fSize.set(fInfo.width(), fInfo.height()); 351 result->fSize.set(fInfo.width(), fInfo.height());
352 return true; 352 return true;
353 } 353 }
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkRWBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698