| OLD | NEW |
| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 fMutability = kImmutable; | 358 fMutability = kImmutable; |
| 359 } | 359 } |
| 360 void SkPixelRef::setTemporarilyImmutable() { | 360 void SkPixelRef::setTemporarilyImmutable() { |
| 361 SkASSERT(fMutability != kImmutable); | 361 SkASSERT(fMutability != kImmutable); |
| 362 fMutability = kTemporarilyImmutable; | 362 fMutability = kTemporarilyImmutable; |
| 363 } | 363 } |
| 364 | 364 |
| 365 void SkPixelRef::restoreMutability() { | 365 void SkPixelRef::restoreMutability() { |
| 366 SkASSERT(fMutability != kImmutable); | 366 SkASSERT(fMutability != kImmutable); |
| 367 fMutability = kMutable; | 367 fMutability = kMutable; |
| 368 this->notifyPixelsChanged(); // This is just precautionary. | |
| 369 } | 368 } |
| 370 | 369 |
| 371 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { | 370 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { |
| 372 return this->onReadPixels(dst, subset); | 371 return this->onReadPixels(dst, subset); |
| 373 } | 372 } |
| 374 | 373 |
| 375 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 374 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 376 | 375 |
| 377 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { | 376 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { |
| 378 return false; | 377 return false; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 405 } | 404 } |
| 406 | 405 |
| 407 result->fUnlockProc = unlock_legacy_result; | 406 result->fUnlockProc = unlock_legacy_result; |
| 408 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc | 407 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc |
| 409 result->fCTable = fRec.fColorTable; | 408 result->fCTable = fRec.fColorTable; |
| 410 result->fPixels = fRec.fPixels; | 409 result->fPixels = fRec.fPixels; |
| 411 result->fRowBytes = fRec.fRowBytes; | 410 result->fRowBytes = fRec.fRowBytes; |
| 412 result->fSize.set(fInfo.width(), fInfo.height()); | 411 result->fSize.set(fInfo.width(), fInfo.height()); |
| 413 return true; | 412 return true; |
| 414 } | 413 } |
| OLD | NEW |