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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 friend class SkSpecialImage_Raster; | 397 friend class SkSpecialImage_Raster; |
398 | 398 |
399 // When copying a bitmap to another with the same shape and config, we can s
afely | 399 // When copying a bitmap to another with the same shape and config, we can s
afely |
400 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 400 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
401 friend class SkBitmap; // only for cloneGenID | 401 friend class SkBitmap; // only for cloneGenID |
402 void cloneGenID(const SkPixelRef&); | 402 void cloneGenID(const SkPixelRef&); |
403 | 403 |
404 void setImmutableWithID(uint32_t genID); | 404 void setImmutableWithID(uint32_t genID); |
405 friend class SkImage_Gpu; | 405 friend class SkImage_Gpu; |
406 friend class SkImageCacherator; | 406 friend class SkImageCacherator; |
| 407 friend class SkSpecialImage_Gpu; |
407 | 408 |
408 typedef SkRefCnt INHERITED; | 409 typedef SkRefCnt INHERITED; |
409 }; | 410 }; |
410 | 411 |
411 class SkPixelRefFactory : public SkRefCnt { | 412 class SkPixelRefFactory : public SkRefCnt { |
412 public: | 413 public: |
413 /** | 414 /** |
414 * Allocate a new pixelref matching the specified ImageInfo, allocating | 415 * Allocate a new pixelref matching the specified ImageInfo, allocating |
415 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 416 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
416 * the pixelref will ref() the colortable. | 417 * the pixelref will ref() the colortable. |
417 * On failure return NULL. | 418 * On failure return NULL. |
418 */ | 419 */ |
419 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 420 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
420 }; | 421 }; |
421 | 422 |
422 #endif | 423 #endif |
OLD | NEW |