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

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

Issue 105893012: change offset to xy for pixelref subsetting (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SkBitmapHeap.h ('k') | src/core/SkOrderedWriteBuffer.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 17 matching lines...) Expand all
28 // will be the only one able to modify it, so it does not 28 // will be the only one able to modify it, so it does not
29 // need to be an atomic operation. 29 // need to be an atomic operation.
30 fRefCount = count; 30 fRefCount = count;
31 } else { 31 } else {
32 sk_atomic_add(&fRefCount, count); 32 sk_atomic_add(&fRefCount, count);
33 } 33 }
34 } 34 }
35 35
36 /////////////////////////////////////////////////////////////////////////////// 36 ///////////////////////////////////////////////////////////////////////////////
37 37
38 static bool operator<(const SkIPoint& a, const SkIPoint& b) {
39 return *(const int64_t*)&a < *(const int64_t*)&b;
40 }
41
42 static bool operator>(const SkIPoint& a, const SkIPoint& b) {
43 return *(const int64_t*)&a > *(const int64_t*)&b;
44 }
45
38 bool SkBitmapHeap::LookupEntry::Less(const SkBitmapHeap::LookupEntry& a, 46 bool SkBitmapHeap::LookupEntry::Less(const SkBitmapHeap::LookupEntry& a,
39 const SkBitmapHeap::LookupEntry& b) { 47 const SkBitmapHeap::LookupEntry& b) {
40 if (a.fGenerationId < b.fGenerationId) { 48 if (a.fGenerationId < b.fGenerationId) {
41 return true; 49 return true;
42 } else if (a.fGenerationId > b.fGenerationId) { 50 } else if (a.fGenerationId > b.fGenerationId) {
43 return false; 51 return false;
44 } else if (a.fPixelOffset < b.fPixelOffset) { 52 } else if (a.fPixelOrigin < b.fPixelOrigin) {
45 return true; 53 return true;
46 } else if (a.fPixelOffset > b.fPixelOffset) { 54 } else if (a.fPixelOrigin > b.fPixelOrigin) {
47 return false; 55 return false;
48 } else if (a.fWidth < b.fWidth) { 56 } else if (a.fWidth < b.fWidth) {
49 return true; 57 return true;
50 } else if (a.fWidth > b.fWidth) { 58 } else if (a.fWidth > b.fWidth) {
51 return false; 59 return false;
52 } else if (a.fHeight < b.fHeight) { 60 } else if (a.fHeight < b.fHeight) {
53 return true; 61 return true;
54 } 62 }
55 return false; 63 return false;
56 } 64 }
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 for (int i = 0; i < fDeferredEntries.count(); i++) { 398 for (int i = 0; i < fDeferredEntries.count(); i++) {
391 SkASSERT(fOwnerCount != IGNORE_OWNERS); 399 SkASSERT(fOwnerCount != IGNORE_OWNERS);
392 SkBitmapHeapEntry* heapEntry = this->getEntry(fDeferredEntries[i]); 400 SkBitmapHeapEntry* heapEntry = this->getEntry(fDeferredEntries[i]);
393 SkASSERT(heapEntry != NULL); 401 SkASSERT(heapEntry != NULL);
394 heapEntry->addReferences(fOwnerCount); 402 heapEntry->addReferences(fOwnerCount);
395 } 403 }
396 } 404 }
397 fDeferAddingOwners = false; 405 fDeferAddingOwners = false;
398 fDeferredEntries.reset(); 406 fDeferredEntries.reset();
399 } 407 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapHeap.h ('k') | src/core/SkOrderedWriteBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698