OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
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 | 8 |
9 | 9 |
10 #ifndef SkPixelRef_DEFINED | 10 #ifndef SkPixelRef_DEFINED |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void setMutex(SkBaseMutex* mutex); | 357 void setMutex(SkBaseMutex* mutex); |
358 | 358 |
359 // When copying a bitmap to another with the same shape and config, we can s
afely | 359 // When copying a bitmap to another with the same shape and config, we can s
afely |
360 // clone the pixelref generation ID too, which makes them equivalent under c
aching. | 360 // clone the pixelref generation ID too, which makes them equivalent under c
aching. |
361 friend class SkBitmap; // only for cloneGenID | 361 friend class SkBitmap; // only for cloneGenID |
362 void cloneGenID(const SkPixelRef&); | 362 void cloneGenID(const SkPixelRef&); |
363 | 363 |
364 typedef SkFlattenable INHERITED; | 364 typedef SkFlattenable INHERITED; |
365 }; | 365 }; |
366 | 366 |
| 367 class SkPixelRefFactory : public SkRefCnt { |
| 368 public: |
| 369 /** |
| 370 * Allocate a new pixelref matching the specified ImageInfo, allocating |
| 371 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
| 372 * the pixelref will ref() the colortable. |
| 373 * On failure return NULL. |
| 374 */ |
| 375 virtual SkPixelRef* create(const SkImageInfo&, SkColorTable*) = 0; |
| 376 }; |
| 377 |
367 #endif | 378 #endif |
OLD | NEW |