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 bool isPreLocked() const { return fPreLocked; } | 374 bool isPreLocked() const { return fPreLocked; } |
375 friend class SkImage_Raster; | 375 friend class SkImage_Raster; |
376 | 376 |
377 // When copying a bitmap to another with the same shape and config, we can s
afely | 377 // When copying a bitmap to another with the same shape and config, we can s
afely |
378 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 378 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
379 friend class SkBitmap; // only for cloneGenID | 379 friend class SkBitmap; // only for cloneGenID |
380 void cloneGenID(const SkPixelRef&); | 380 void cloneGenID(const SkPixelRef&); |
381 | 381 |
382 void setImmutableWithID(uint32_t genID); | 382 void setImmutableWithID(uint32_t genID); |
383 friend class SkImage_Gpu; | 383 friend class SkImage_Gpu; |
| 384 friend class SkImageCacherator; |
384 | 385 |
385 typedef SkRefCnt INHERITED; | 386 typedef SkRefCnt INHERITED; |
386 }; | 387 }; |
387 | 388 |
388 class SkPixelRefFactory : public SkRefCnt { | 389 class SkPixelRefFactory : public SkRefCnt { |
389 public: | 390 public: |
390 /** | 391 /** |
391 * Allocate a new pixelref matching the specified ImageInfo, allocating | 392 * Allocate a new pixelref matching the specified ImageInfo, allocating |
392 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 393 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
393 * the pixelref will ref() the colortable. | 394 * the pixelref will ref() the colortable. |
394 * On failure return NULL. | 395 * On failure return NULL. |
395 */ | 396 */ |
396 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 397 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
397 }; | 398 }; |
398 | 399 |
399 #endif | 400 #endif |
OLD | NEW |