| OLD | NEW |
| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 fUniqueGenerationID = false; | 131 fUniqueGenerationID = false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void SkPixelRef::cloneGenID(const SkPixelRef& that) { | 134 void SkPixelRef::cloneGenID(const SkPixelRef& that) { |
| 135 // This is subtle. We must call that.getGenerationID() to make sure its gen
ID isn't 0. | 135 // This is subtle. We must call that.getGenerationID() to make sure its gen
ID isn't 0. |
| 136 this->fGenerationID = that.getGenerationID(); | 136 this->fGenerationID = that.getGenerationID(); |
| 137 this->fUniqueGenerationID = false; | 137 this->fUniqueGenerationID = false; |
| 138 that.fUniqueGenerationID = false; | 138 that.fUniqueGenerationID = false; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void SkPixelRef::setPreLocked(void* pixels, SkColorTable* ctable) { | 141 // rowBytes will be respected when we land the onNewLockPixels CL |
| 142 void SkPixelRef::setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctabl
e) { |
| 142 #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED | 143 #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED |
| 143 // only call me in your constructor, otherwise fLockCount tracking can get | 144 // only call me in your constructor, otherwise fLockCount tracking can get |
| 144 // out of sync. | 145 // out of sync. |
| 145 fPixels = pixels; | 146 fPixels = pixels; |
| 146 fColorTable = ctable; | 147 fColorTable = ctable; |
| 147 fLockCount = SKPIXELREF_PRELOCKED_LOCKCOUNT; | 148 fLockCount = SKPIXELREF_PRELOCKED_LOCKCOUNT; |
| 148 fPreLocked = true; | 149 fPreLocked = true; |
| 149 #endif | 150 #endif |
| 150 } | 151 } |
| 151 | 152 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 281 |
| 281 #ifdef SK_BUILD_FOR_ANDROID | 282 #ifdef SK_BUILD_FOR_ANDROID |
| 282 void SkPixelRef::globalRef(void* data) { | 283 void SkPixelRef::globalRef(void* data) { |
| 283 this->ref(); | 284 this->ref(); |
| 284 } | 285 } |
| 285 | 286 |
| 286 void SkPixelRef::globalUnref() { | 287 void SkPixelRef::globalUnref() { |
| 287 this->unref(); | 288 this->unref(); |
| 288 } | 289 } |
| 289 #endif | 290 #endif |
| OLD | NEW |