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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 friend class SkSurface_Raster; // For the two methods above. | 372 friend class SkSurface_Raster; // For the two methods above. |
373 | 373 |
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); |
| 383 friend class SkImage_Gpu; |
| 384 |
382 typedef SkRefCnt INHERITED; | 385 typedef SkRefCnt INHERITED; |
383 }; | 386 }; |
384 | 387 |
385 class SkPixelRefFactory : public SkRefCnt { | 388 class SkPixelRefFactory : public SkRefCnt { |
386 public: | 389 public: |
387 /** | 390 /** |
388 * Allocate a new pixelref matching the specified ImageInfo, allocating | 391 * Allocate a new pixelref matching the specified ImageInfo, allocating |
389 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 392 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
390 * the pixelref will ref() the colortable. | 393 * the pixelref will ref() the colortable. |
391 * On failure return NULL. | 394 * On failure return NULL. |
392 */ | 395 */ |
393 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 396 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
394 }; | 397 }; |
395 | 398 |
396 #endif | 399 #endif |
OLD | NEW |