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 "SkPixelRef.h" | 9 #include "SkPixelRef.h" |
10 #include "SkThread.h" | 10 #include "SkThread.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 328 } |
329 | 329 |
330 void SkPixelRef::notifyPixelsChanged() { | 330 void SkPixelRef::notifyPixelsChanged() { |
331 #ifdef SK_DEBUG | 331 #ifdef SK_DEBUG |
332 if (fIsImmutable) { | 332 if (fIsImmutable) { |
333 SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); | 333 SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); |
334 } | 334 } |
335 #endif | 335 #endif |
336 this->callGenIDChangeListeners(); | 336 this->callGenIDChangeListeners(); |
337 this->needsNewGenID(); | 337 this->needsNewGenID(); |
| 338 this->onNotifyPixelsChanged(); |
338 } | 339 } |
339 | 340 |
340 void SkPixelRef::changeAlphaType(SkAlphaType at) { | 341 void SkPixelRef::changeAlphaType(SkAlphaType at) { |
341 *const_cast<SkImageInfo*>(&fInfo) = fInfo.makeAlphaType(at); | 342 *const_cast<SkImageInfo*>(&fInfo) = fInfo.makeAlphaType(at); |
342 } | 343 } |
343 | 344 |
344 void SkPixelRef::setImmutable() { | 345 void SkPixelRef::setImmutable() { |
345 fIsImmutable = true; | 346 fIsImmutable = true; |
346 } | 347 } |
347 | 348 |
348 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { | 349 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { |
349 return this->onReadPixels(dst, subset); | 350 return this->onReadPixels(dst, subset); |
350 } | 351 } |
351 | 352 |
352 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 353 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
353 | 354 |
354 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { | 355 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { |
355 return false; | 356 return false; |
356 } | 357 } |
357 | 358 |
| 359 void SkPixelRef::onNotifyPixelsChanged() { } |
| 360 |
358 SkData* SkPixelRef::onRefEncodedData() { | 361 SkData* SkPixelRef::onRefEncodedData() { |
359 return NULL; | 362 return NULL; |
360 } | 363 } |
361 | 364 |
362 bool SkPixelRef::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], | 365 bool SkPixelRef::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
363 SkYUVColorSpace* colorSpace) { | 366 SkYUVColorSpace* colorSpace) { |
364 return false; | 367 return false; |
365 } | 368 } |
366 | 369 |
367 size_t SkPixelRef::getAllocatedSizeInBytes() const { | 370 size_t SkPixelRef::getAllocatedSizeInBytes() const { |
(...skipping 12 matching lines...) Expand all Loading... |
380 } | 383 } |
381 | 384 |
382 result->fUnlockProc = unlock_legacy_result; | 385 result->fUnlockProc = unlock_legacy_result; |
383 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc | 386 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc |
384 result->fCTable = fRec.fColorTable; | 387 result->fCTable = fRec.fColorTable; |
385 result->fPixels = fRec.fPixels; | 388 result->fPixels = fRec.fPixels; |
386 result->fRowBytes = fRec.fRowBytes; | 389 result->fRowBytes = fRec.fRowBytes; |
387 result->fSize.set(fInfo.width(), fInfo.height()); | 390 result->fSize.set(fInfo.width(), fInfo.height()); |
388 return true; | 391 return true; |
389 } | 392 } |
OLD | NEW |