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

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

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/SkBitmapDevice.cpp ('k') | src/core/SkBlitter.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 2012 Google Inc. 3 * Copyright 2012 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 8
9 #include "SkBitmapHeap.h" 9 #include "SkBitmapHeap.h"
10 10
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // If the bitmap is mutable, we need to do a deep copy, since the 252 // If the bitmap is mutable, we need to do a deep copy, since the
253 // caller may modify it afterwards. 253 // caller may modify it afterwards.
254 if (originalBitmap.isImmutable()) { 254 if (originalBitmap.isImmutable()) {
255 copiedBitmap = originalBitmap; 255 copiedBitmap = originalBitmap;
256 // TODO if we have the pixel ref in the heap we could pass it here to avoid a po tential deep copy 256 // TODO if we have the pixel ref in the heap we could pass it here to avoid a po tential deep copy
257 // else if (sharedPixelRef != NULL) { 257 // else if (sharedPixelRef != NULL) {
258 // copiedBitmap = orig; 258 // copiedBitmap = orig;
259 // copiedBitmap.setPixelRef(sharedPixelRef, originalBitmap.pixelRefOffset ()); 259 // copiedBitmap.setPixelRef(sharedPixelRef, originalBitmap.pixelRefOffset ());
260 } else if (originalBitmap.empty()) { 260 } else if (originalBitmap.empty()) {
261 copiedBitmap.reset(); 261 copiedBitmap.reset();
262 } else if (!originalBitmap.deepCopyTo(&copiedBitmap, originalBitmap.getConfi g())) { 262 } else if (!originalBitmap.deepCopyTo(&copiedBitmap, originalBitmap.config() )) {
263 return false; 263 return false;
264 } 264 }
265 copiedBitmap.setImmutable(); 265 copiedBitmap.setImmutable();
266 return true; 266 return true;
267 } 267 }
268 268
269 int SkBitmapHeap::removeEntryFromLookupTable(LookupEntry* entry) { 269 int SkBitmapHeap::removeEntryFromLookupTable(LookupEntry* entry) {
270 // remove the bitmap index for the deleted entry 270 // remove the bitmap index for the deleted entry
271 SkDEBUGCODE(int count = fLookupTable.count();) 271 SkDEBUGCODE(int count = fLookupTable.count();)
272 int index = this->findInLookupTable(*entry, NULL); 272 int index = this->findInLookupTable(*entry, NULL);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 for (int i = 0; i < fDeferredEntries.count(); i++) { 393 for (int i = 0; i < fDeferredEntries.count(); i++) {
394 SkASSERT(fOwnerCount != IGNORE_OWNERS); 394 SkASSERT(fOwnerCount != IGNORE_OWNERS);
395 SkBitmapHeapEntry* heapEntry = this->getEntry(fDeferredEntries[i]); 395 SkBitmapHeapEntry* heapEntry = this->getEntry(fDeferredEntries[i]);
396 SkASSERT(heapEntry != NULL); 396 SkASSERT(heapEntry != NULL);
397 heapEntry->addReferences(fOwnerCount); 397 heapEntry->addReferences(fOwnerCount);
398 } 398 }
399 } 399 }
400 fDeferAddingOwners = false; 400 fDeferAddingOwners = false;
401 fDeferredEntries.reset(); 401 fDeferredEntries.reset();
402 } 402 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkBlitter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698