OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
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 #ifndef SkPixelRef_DEFINED | 8 #ifndef SkPixelRef_DEFINED |
9 #define SkPixelRef_DEFINED | 9 #define SkPixelRef_DEFINED |
10 | 10 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 void needsNewGenID(); | 375 void needsNewGenID(); |
376 void callGenIDChangeListeners(); | 376 void callGenIDChangeListeners(); |
377 | 377 |
378 void setTemporarilyImmutable(); | 378 void setTemporarilyImmutable(); |
379 void restoreMutability(); | 379 void restoreMutability(); |
380 friend class SkSurface_Raster; // For the two methods above. | 380 friend class SkSurface_Raster; // For the two methods above. |
381 | 381 |
382 bool isPreLocked() const { return fPreLocked; } | 382 bool isPreLocked() const { return fPreLocked; } |
383 friend class SkImage_Raster; | 383 friend class SkImage_Raster; |
| 384 friend class SkSpecialImage_Raster; |
384 | 385 |
385 // When copying a bitmap to another with the same shape and config, we can s
afely | 386 // When copying a bitmap to another with the same shape and config, we can s
afely |
386 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 387 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
387 friend class SkBitmap; // only for cloneGenID | 388 friend class SkBitmap; // only for cloneGenID |
388 void cloneGenID(const SkPixelRef&); | 389 void cloneGenID(const SkPixelRef&); |
389 | 390 |
390 void setImmutableWithID(uint32_t genID); | 391 void setImmutableWithID(uint32_t genID); |
391 friend class SkImage_Gpu; | 392 friend class SkImage_Gpu; |
392 friend class SkImageCacherator; | 393 friend class SkImageCacherator; |
393 | 394 |
394 typedef SkRefCnt INHERITED; | 395 typedef SkRefCnt INHERITED; |
395 }; | 396 }; |
396 | 397 |
397 class SkPixelRefFactory : public SkRefCnt { | 398 class SkPixelRefFactory : public SkRefCnt { |
398 public: | 399 public: |
399 /** | 400 /** |
400 * Allocate a new pixelref matching the specified ImageInfo, allocating | 401 * Allocate a new pixelref matching the specified ImageInfo, allocating |
401 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 402 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
402 * the pixelref will ref() the colortable. | 403 * the pixelref will ref() the colortable. |
403 * On failure return NULL. | 404 * On failure return NULL. |
404 */ | 405 */ |
405 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 406 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
406 }; | 407 }; |
407 | 408 |
408 #endif | 409 #endif |
OLD | NEW |