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 "SkFlattenableBuffers.h" | 9 #include "SkFlattenableBuffers.h" |
10 #include "SkThread.h" | 10 #include "SkThread.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 void SkPixelRef::notifyPixelsChanged() { | 257 void SkPixelRef::notifyPixelsChanged() { |
258 #ifdef SK_DEBUG | 258 #ifdef SK_DEBUG |
259 if (fIsImmutable) { | 259 if (fIsImmutable) { |
260 SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); | 260 SkDebugf("========== notifyPixelsChanged called on immutable pixelref"); |
261 } | 261 } |
262 #endif | 262 #endif |
263 this->callGenIDChangeListeners(); | 263 this->callGenIDChangeListeners(); |
264 this->needsNewGenID(); | 264 this->needsNewGenID(); |
265 } | 265 } |
266 | 266 |
267 void SkPixelRef::notifyAlphaTypeChanged(SkAlphaType at) { | |
268 if (fInfo.fAlphaType != at) { | |
269 *const_cast<SkAlphaType*>(&fInfo.fAlphaType) = at; | |
270 this->callGenIDChangeListeners(); | |
scroggo
2014/01/24 20:50:52
I kind of think these two functions should be the
reed1
2014/01/27 13:46:14
I'll sync with the GPU guys, who invented this pat
| |
271 this->needsNewGenID(); | |
272 } | |
273 } | |
274 | |
267 void SkPixelRef::setImmutable() { | 275 void SkPixelRef::setImmutable() { |
268 fIsImmutable = true; | 276 fIsImmutable = true; |
269 } | 277 } |
270 | 278 |
271 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { | 279 bool SkPixelRef::readPixels(SkBitmap* dst, const SkIRect* subset) { |
272 return this->onReadPixels(dst, subset); | 280 return this->onReadPixels(dst, subset); |
273 } | 281 } |
274 | 282 |
275 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { | 283 bool SkPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) { |
276 return false; | 284 return false; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 319 |
312 #ifdef SK_BUILD_FOR_ANDROID | 320 #ifdef SK_BUILD_FOR_ANDROID |
313 void SkPixelRef::globalRef(void* data) { | 321 void SkPixelRef::globalRef(void* data) { |
314 this->ref(); | 322 this->ref(); |
315 } | 323 } |
316 | 324 |
317 void SkPixelRef::globalUnref() { | 325 void SkPixelRef::globalUnref() { |
318 this->unref(); | 326 this->unref(); |
319 } | 327 } |
320 #endif | 328 #endif |
OLD | NEW |