epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
reed | 3b72f79 | 2014-07-14 10:13:57 -0700 | [diff] [blame] | 7 | |
reed | 7eeba25 | 2015-02-24 13:54:23 -0800 | [diff] [blame] | 8 | #include "SkBitmapCache.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 9 | #include "SkPixelRef.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 10 | #include "SkThread.h" |
| 11 | |
mtklein | 4daa6f6 | 2015-01-21 19:51:27 -0800 | [diff] [blame] | 12 | #ifdef SK_BUILD_FOR_WIN32 |
| 13 | // We don't have SK_BASE_MUTEX_INIT on Windows. |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 14 | |
mtklein | 4daa6f6 | 2015-01-21 19:51:27 -0800 | [diff] [blame] | 15 | // must be a power-of-2. undef to just use 1 mutex |
| 16 | #define PIXELREF_MUTEX_RING_COUNT 32 |
| 17 | static SkBaseMutex gPixelRefMutexRing[PIXELREF_MUTEX_RING_COUNT]; |
| 18 | |
| 19 | #else |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 20 | static SkBaseMutex gPixelRefMutexRing[] = { |
mtklein | b83f6c3 | 2014-06-09 14:18:02 -0700 | [diff] [blame] | 21 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 22 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 23 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 24 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 25 | |
mtklein | b83f6c3 | 2014-06-09 14:18:02 -0700 | [diff] [blame] | 26 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 27 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 28 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 29 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 30 | |
mtklein | b83f6c3 | 2014-06-09 14:18:02 -0700 | [diff] [blame] | 31 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 32 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 33 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 34 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 35 | |
mtklein | b83f6c3 | 2014-06-09 14:18:02 -0700 | [diff] [blame] | 36 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 37 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 38 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
| 39 | SK_BASE_MUTEX_INIT, SK_BASE_MUTEX_INIT, |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 40 | }; |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 41 | // must be a power-of-2. undef to just use 1 mutex |
| 42 | #define PIXELREF_MUTEX_RING_COUNT SK_ARRAY_COUNT(gPixelRefMutexRing) |
| 43 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 44 | #endif |
| 45 | |
caryclark@google.com | 803eceb | 2012-06-06 12:09:34 +0000 | [diff] [blame] | 46 | static SkBaseMutex* get_default_mutex() { |
reed@google.com | dd96eb4 | 2013-04-12 15:34:53 +0000 | [diff] [blame] | 47 | static int32_t gPixelRefMutexRingIndex; |
| 48 | |
| 49 | SkASSERT(SkIsPow2(PIXELREF_MUTEX_RING_COUNT)); |
| 50 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 51 | // atomic_inc might be overkill here. It may be fine if once in a while |
| 52 | // we hit a race-condition and two subsequent calls get the same index... |
| 53 | int index = sk_atomic_inc(&gPixelRefMutexRingIndex); |
| 54 | return &gPixelRefMutexRing[index & (PIXELREF_MUTEX_RING_COUNT - 1)]; |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | /////////////////////////////////////////////////////////////////////////////// |
bsalomon@google.com | 586f48c | 2011-04-14 15:07:22 +0000 | [diff] [blame] | 58 | |
bsalomon@google.com | 100abf4 | 2012-09-05 17:40:04 +0000 | [diff] [blame] | 59 | int32_t SkNextPixelRefGenerationID(); |
| 60 | |
reed@google.com | 9c49bc3 | 2011-07-07 13:42:37 +0000 | [diff] [blame] | 61 | int32_t SkNextPixelRefGenerationID() { |
bsalomon@google.com | 586f48c | 2011-04-14 15:07:22 +0000 | [diff] [blame] | 62 | static int32_t gPixelRefGenerationID; |
| 63 | // do a loop in case our global wraps around, as we never want to |
| 64 | // return a 0 |
| 65 | int32_t genID; |
| 66 | do { |
| 67 | genID = sk_atomic_inc(&gPixelRefGenerationID) + 1; |
| 68 | } while (0 == genID); |
| 69 | return genID; |
| 70 | } |
| 71 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 72 | /////////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 73 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 74 | void SkPixelRef::setMutex(SkBaseMutex* mutex) { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 75 | if (NULL == mutex) { |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 76 | mutex = get_default_mutex(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 77 | } |
| 78 | fMutex = mutex; |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | // just need a > 0 value, so pick a funny one to aid in debugging |
| 82 | #define SKPIXELREF_PRELOCKED_LOCKCOUNT 123456789 |
| 83 | |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 84 | static SkImageInfo validate_info(const SkImageInfo& info) { |
| 85 | SkAlphaType newAlphaType = info.alphaType(); |
| 86 | SkAssertResult(SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &newAlphaType)); |
| 87 | return info.makeAlphaType(newAlphaType); |
| 88 | } |
scroggo | 2fd0d14 | 2014-07-01 07:08:19 -0700 | [diff] [blame] | 89 | |
scroggo | f3ca41c | 2014-11-25 13:42:12 -0800 | [diff] [blame] | 90 | SkPixelRef::SkPixelRef(const SkImageInfo& info) |
| 91 | : fInfo(validate_info(info)) |
| 92 | #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 93 | , fStableID(SkNextPixelRefGenerationID()) |
| 94 | #endif |
| 95 | |
| 96 | { |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 97 | this->setMutex(NULL); |
| 98 | fRec.zero(); |
commit-bot@chromium.org | ff9c6c9 | 2013-12-11 20:55:41 +0000 | [diff] [blame] | 99 | fLockCount = 0; |
| 100 | this->needsNewGenID(); |
| 101 | fIsImmutable = false; |
| 102 | fPreLocked = false; |
reed | 83787d0 | 2015-02-25 07:17:11 -0800 | [diff] [blame^] | 103 | fAddedToCache.store(false); |
commit-bot@chromium.org | ff9c6c9 | 2013-12-11 20:55:41 +0000 | [diff] [blame] | 104 | } |
commit-bot@chromium.org | ff9c6c9 | 2013-12-11 20:55:41 +0000 | [diff] [blame] | 105 | |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 106 | |
scroggo | f3ca41c | 2014-11-25 13:42:12 -0800 | [diff] [blame] | 107 | SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) |
| 108 | : fInfo(validate_info(info)) |
| 109 | #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 110 | , fStableID(SkNextPixelRefGenerationID()) |
| 111 | #endif |
| 112 | { |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 113 | this->setMutex(mutex); |
| 114 | fRec.zero(); |
reed@google.com | 398337b | 2013-12-11 21:22:39 +0000 | [diff] [blame] | 115 | fLockCount = 0; |
| 116 | this->needsNewGenID(); |
| 117 | fIsImmutable = false; |
| 118 | fPreLocked = false; |
reed | 83787d0 | 2015-02-25 07:17:11 -0800 | [diff] [blame^] | 119 | fAddedToCache.store(false); |
reed@google.com | 398337b | 2013-12-11 21:22:39 +0000 | [diff] [blame] | 120 | } |
reed@google.com | 398337b | 2013-12-11 21:22:39 +0000 | [diff] [blame] | 121 | |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 122 | SkPixelRef::~SkPixelRef() { |
| 123 | this->callGenIDChangeListeners(); |
| 124 | } |
| 125 | |
| 126 | void SkPixelRef::needsNewGenID() { |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 127 | fGenerationID.store(0); |
| 128 | fUniqueGenerationID.store(false); |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | void SkPixelRef::cloneGenID(const SkPixelRef& that) { |
| 132 | // This is subtle. We must call that.getGenerationID() to make sure its genID isn't 0. |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 133 | this->fGenerationID.store(that.getGenerationID()); |
| 134 | this->fUniqueGenerationID.store(false); |
| 135 | that.fUniqueGenerationID.store(false); |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 136 | } |
| 137 | |
reed@google.com | 7627c65 | 2014-01-06 15:01:48 +0000 | [diff] [blame] | 138 | void SkPixelRef::setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctable) { |
reed@google.com | 2a3f08b | 2012-12-13 21:41:00 +0000 | [diff] [blame] | 139 | #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 140 | // only call me in your constructor, otherwise fLockCount tracking can get |
| 141 | // out of sync. |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 142 | fRec.fPixels = pixels; |
| 143 | fRec.fColorTable = ctable; |
| 144 | fRec.fRowBytes = rowBytes; |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 145 | fLockCount = SKPIXELREF_PRELOCKED_LOCKCOUNT; |
| 146 | fPreLocked = true; |
reed@google.com | 2a3f08b | 2012-12-13 21:41:00 +0000 | [diff] [blame] | 147 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 148 | } |
| 149 | |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 150 | bool SkPixelRef::lockPixels(LockRec* rec) { |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 151 | SkASSERT(!fPreLocked || SKPIXELREF_PRELOCKED_LOCKCOUNT == fLockCount); |
skia.committer@gmail.com | 98272d9 | 2014-01-04 07:01:40 +0000 | [diff] [blame] | 152 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 153 | if (!fPreLocked) { |
| 154 | SkAutoMutexAcquire ac(*fMutex); |
skia.committer@gmail.com | 98272d9 | 2014-01-04 07:01:40 +0000 | [diff] [blame] | 155 | |
commit-bot@chromium.org | 27f8902 | 2014-01-03 16:32:45 +0000 | [diff] [blame] | 156 | if (1 == ++fLockCount) { |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 157 | SkASSERT(fRec.isZero()); |
| 158 | |
| 159 | LockRec rec; |
| 160 | if (!this->onNewLockPixels(&rec)) { |
| 161 | return false; |
reed@google.com | c83a91f | 2013-12-13 13:41:14 +0000 | [diff] [blame] | 162 | } |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 163 | SkASSERT(!rec.isZero()); // else why did onNewLock return true? |
| 164 | fRec = rec; |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 165 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 166 | } |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 167 | *rec = fRec; |
| 168 | return true; |
| 169 | } |
| 170 | |
| 171 | bool SkPixelRef::lockPixels() { |
| 172 | LockRec rec; |
| 173 | return this->lockPixels(&rec); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | void SkPixelRef::unlockPixels() { |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 177 | SkASSERT(!fPreLocked || SKPIXELREF_PRELOCKED_LOCKCOUNT == fLockCount); |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 178 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 179 | if (!fPreLocked) { |
| 180 | SkAutoMutexAcquire ac(*fMutex); |
reed@google.com | 93c5f9e | 2011-02-24 18:09:46 +0000 | [diff] [blame] | 181 | |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 182 | SkASSERT(fLockCount > 0); |
| 183 | if (0 == --fLockCount) { |
reed@google.com | c83a91f | 2013-12-13 13:41:14 +0000 | [diff] [blame] | 184 | // don't call onUnlockPixels unless onLockPixels succeeded |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 185 | if (fRec.fPixels) { |
reed@google.com | c83a91f | 2013-12-13 13:41:14 +0000 | [diff] [blame] | 186 | this->onUnlockPixels(); |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 187 | fRec.zero(); |
reed@google.com | c83a91f | 2013-12-13 13:41:14 +0000 | [diff] [blame] | 188 | } else { |
reed@google.com | d0419b1 | 2014-01-06 17:08:27 +0000 | [diff] [blame] | 189 | SkASSERT(fRec.isZero()); |
reed@google.com | c83a91f | 2013-12-13 13:41:14 +0000 | [diff] [blame] | 190 | } |
reed@google.com | ff0da4f | 2012-05-17 13:14:52 +0000 | [diff] [blame] | 191 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | |
reed@google.com | 9c49bc3 | 2011-07-07 13:42:37 +0000 | [diff] [blame] | 195 | bool SkPixelRef::lockPixelsAreWritable() const { |
| 196 | return this->onLockPixelsAreWritable(); |
| 197 | } |
| 198 | |
| 199 | bool SkPixelRef::onLockPixelsAreWritable() const { |
| 200 | return true; |
| 201 | } |
| 202 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 203 | uint32_t SkPixelRef::getGenerationID() const { |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 204 | uint32_t id = fGenerationID.load(); |
| 205 | if (0 == id) { |
| 206 | id = SkNextPixelRefGenerationID(); |
| 207 | fGenerationID.store(id); |
| 208 | fUniqueGenerationID.store(true); // The only time we can be sure of this! |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 209 | } |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 210 | return id; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 211 | } |
| 212 | |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 213 | void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) { |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 214 | if (NULL == listener || !fUniqueGenerationID.load()) { |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 215 | // No point in tracking this if we're not going to call it. |
| 216 | SkDELETE(listener); |
| 217 | return; |
| 218 | } |
| 219 | *fGenIDChangeListeners.append() = listener; |
| 220 | } |
| 221 | |
reed | 7eeba25 | 2015-02-24 13:54:23 -0800 | [diff] [blame] | 222 | // we need to be called *before* the genID gets changed or zerod |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 223 | void SkPixelRef::callGenIDChangeListeners() { |
| 224 | // We don't invalidate ourselves if we think another SkPixelRef is sharing our genID. |
mtklein | 86821b5 | 2015-02-24 14:38:12 -0800 | [diff] [blame] | 225 | if (fUniqueGenerationID.load()) { |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 226 | for (int i = 0; i < fGenIDChangeListeners.count(); i++) { |
| 227 | fGenIDChangeListeners[i]->onChange(); |
| 228 | } |
reed | 7eeba25 | 2015-02-24 13:54:23 -0800 | [diff] [blame] | 229 | |
reed | 83787d0 | 2015-02-25 07:17:11 -0800 | [diff] [blame^] | 230 | // TODO: SkAtomic could add "old_value = atomic.xchg(new_value)" to make this clearer. |
| 231 | if (fAddedToCache.load()) { |
| 232 | SkNotifyBitmapGenIDIsStale(this->getGenerationID()); |
| 233 | fAddedToCache.store(false); |
| 234 | } |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 235 | } |
| 236 | // Listeners get at most one shot, so whether these triggered or not, blow them away. |
| 237 | fGenIDChangeListeners.deleteAll(); |
| 238 | } |
| 239 | |
reed@google.com | c1587f9 | 2014-01-28 16:05:39 +0000 | [diff] [blame] | 240 | void SkPixelRef::notifyPixelsChanged() { |
reed@android.com | 3eab80c | 2009-03-24 18:47:35 +0000 | [diff] [blame] | 241 | #ifdef SK_DEBUG |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 242 | if (fIsImmutable) { |
| 243 | SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 244 | } |
reed@android.com | 3eab80c | 2009-03-24 18:47:35 +0000 | [diff] [blame] | 245 | #endif |
commit-bot@chromium.org | 50a3043 | 2013-10-24 17:44:27 +0000 | [diff] [blame] | 246 | this->callGenIDChangeListeners(); |
| 247 | this->needsNewGenID(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 248 | } |
| 249 | |
reed@google.com | c1587f9 | 2014-01-28 16:05:39 +0000 | [diff] [blame] | 250 | void SkPixelRef::changeAlphaType(SkAlphaType at) { |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 251 | *const_cast<SkImageInfo*>(&fInfo) = fInfo.makeAlphaType(at); |
reed@google.com | c1587f9 | 2014-01-28 16:05:39 +0000 | [diff] [blame] | 252 | } |
| 253 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 254 | void SkPixelRef::setImmutable() { |
| 255 | fIsImmutable = true; |
| 256 | } |
| 257 | |
reed@google.com | 50dfa01 | 2011-04-01 19:05:36 +0000 | [diff] [blame] | 258 | bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { |
| 259 | return this->onReadPixels(dst, subset); |
| 260 | } |
| 261 | |
| 262 | bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { |
| 263 | return false; |
| 264 | } |
| 265 | |
reed@google.com | eb77612 | 2012-12-06 14:26:02 +0000 | [diff] [blame] | 266 | SkData* SkPixelRef::onRefEncodedData() { |
| 267 | return NULL; |
| 268 | } |
| 269 | |
rileya | abaef86 | 2014-09-12 17:45:58 -0700 | [diff] [blame] | 270 | bool SkPixelRef::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| 271 | SkYUVColorSpace* colorSpace) { |
sugoi | 518d83d | 2014-07-21 11:37:39 -0700 | [diff] [blame] | 272 | return false; |
| 273 | } |
| 274 | |
commit-bot@chromium.org | cd3b15c | 2013-12-04 17:06:49 +0000 | [diff] [blame] | 275 | size_t SkPixelRef::getAllocatedSizeInBytes() const { |
| 276 | return 0; |
| 277 | } |
| 278 | |