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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 bool SkPixelRef::onReadPixels(SkBitmap* dst, SkColorType, const SkIRect* subset)
{ | 316 bool SkPixelRef::onReadPixels(SkBitmap* dst, SkColorType, const SkIRect* subset)
{ |
317 return false; | 317 return false; |
318 } | 318 } |
319 | 319 |
320 void SkPixelRef::onNotifyPixelsChanged() { } | 320 void SkPixelRef::onNotifyPixelsChanged() { } |
321 | 321 |
322 SkData* SkPixelRef::onRefEncodedData() { | 322 SkData* SkPixelRef::onRefEncodedData() { |
323 return nullptr; | 323 return nullptr; |
324 } | 324 } |
325 | 325 |
| 326 bool SkPixelRef::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
| 327 SkYUVColorSpace* colorSpace) { |
| 328 return false; |
| 329 } |
| 330 |
326 size_t SkPixelRef::getAllocatedSizeInBytes() const { | 331 size_t SkPixelRef::getAllocatedSizeInBytes() const { |
327 return 0; | 332 return 0; |
328 } | 333 } |
329 | 334 |
330 static void unlock_legacy_result(void* ctx) { | 335 static void unlock_legacy_result(void* ctx) { |
331 SkPixelRef* pr = (SkPixelRef*)ctx; | 336 SkPixelRef* pr = (SkPixelRef*)ctx; |
332 pr->unlockPixels(); | 337 pr->unlockPixels(); |
333 pr->unref(); // balancing the Ref in onRequestLoc | 338 pr->unref(); // balancing the Ref in onRequestLoc |
334 } | 339 } |
335 | 340 |
336 bool SkPixelRef::onRequestLock(const LockRequest& request, LockResult* result) { | 341 bool SkPixelRef::onRequestLock(const LockRequest& request, LockResult* result) { |
337 if (!this->lockPixelsInsideMutex()) { | 342 if (!this->lockPixelsInsideMutex()) { |
338 return false; | 343 return false; |
339 } | 344 } |
340 | 345 |
341 result->fUnlockProc = unlock_legacy_result; | 346 result->fUnlockProc = unlock_legacy_result; |
342 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc | 347 result->fUnlockContext = SkRef(this); // this is balanced in our fUnlockPr
oc |
343 result->fCTable = fRec.fColorTable; | 348 result->fCTable = fRec.fColorTable; |
344 result->fPixels = fRec.fPixels; | 349 result->fPixels = fRec.fPixels; |
345 result->fRowBytes = fRec.fRowBytes; | 350 result->fRowBytes = fRec.fRowBytes; |
346 result->fSize.set(fInfo.width(), fInfo.height()); | 351 result->fSize.set(fInfo.width(), fInfo.height()); |
347 return true; | 352 return true; |
348 } | 353 } |
OLD | NEW |