| 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 "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 SkData* SkPixelRef::onRefEncodedData() { | 284 SkData* SkPixelRef::onRefEncodedData() { |
| 285 return NULL; | 285 return NULL; |
| 286 } | 286 } |
| 287 | 287 |
| 288 size_t SkPixelRef::getAllocatedSizeInBytes() const { | 288 size_t SkPixelRef::getAllocatedSizeInBytes() const { |
| 289 return 0; | 289 return 0; |
| 290 } | 290 } |
| 291 | 291 |
| 292 /////////////////////////////////////////////////////////////////////////////// | 292 /////////////////////////////////////////////////////////////////////////////// |
| 293 | 293 |
| 294 #ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS | |
| 295 | |
| 296 void* SkPixelRef::onLockPixels(SkColorTable** ctable) { | |
| 297 return NULL; | |
| 298 } | |
| 299 | |
| 300 bool SkPixelRef::onNewLockPixels(LockRec* rec) { | |
| 301 SkColorTable* ctable = NULL; // for legacy clients who forget to set this | |
| 302 void* pixels = this->onLockPixels(&ctable); | |
| 303 if (!pixels) { | |
| 304 return false; | |
| 305 } | |
| 306 | |
| 307 rec->fPixels = pixels; | |
| 308 rec->fColorTable = ctable; | |
| 309 rec->fRowBytes = 0; // callers don't currently need this (thank goodness) | |
| 310 return true; | |
| 311 } | |
| 312 | |
| 313 #endif | |
| 314 | |
| 315 /////////////////////////////////////////////////////////////////////////////// | |
| 316 | |
| 317 #ifdef SK_BUILD_FOR_ANDROID | 294 #ifdef SK_BUILD_FOR_ANDROID |
| 318 void SkPixelRef::globalRef(void* data) { | 295 void SkPixelRef::globalRef(void* data) { |
| 319 this->ref(); | 296 this->ref(); |
| 320 } | 297 } |
| 321 | 298 |
| 322 void SkPixelRef::globalUnref() { | 299 void SkPixelRef::globalUnref() { |
| 323 this->unref(); | 300 this->unref(); |
| 324 } | 301 } |
| 325 #endif | 302 #endif |
| OLD | NEW |