OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
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 SkGrPixelRef_DEFINED | 8 #ifndef SkGrPixelRef_DEFINED |
9 #define SkGrPixelRef_DEFINED | 9 #define SkGrPixelRef_DEFINED |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * Constructs a pixel ref around a GrSurface. If the caller has locked the G
rSurface in the | 44 * Constructs a pixel ref around a GrSurface. If the caller has locked the G
rSurface in the |
45 * cache and would like the pixel ref to unlock it in its destructor then tr
ansferCacheLock | 45 * cache and would like the pixel ref to unlock it in its destructor then tr
ansferCacheLock |
46 * should be set to true. | 46 * should be set to true. |
47 */ | 47 */ |
48 SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false)
; | 48 SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false)
; |
49 virtual ~SkGrPixelRef(); | 49 virtual ~SkGrPixelRef(); |
50 | 50 |
51 // override from SkPixelRef | 51 // override from SkPixelRef |
52 virtual GrTexture* getTexture() SK_OVERRIDE; | 52 virtual GrTexture* getTexture() SK_OVERRIDE; |
53 | 53 |
54 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE | |
55 SK_DECLARE_UNFLATTENABLE_OBJECT() | |
56 #endif | |
57 | |
58 protected: | 54 protected: |
59 // overrides from SkPixelRef | 55 // overrides from SkPixelRef |
60 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE; | 56 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subset) SK_OVERRIDE; |
61 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE
; | 57 virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* subset) SK_OVERRIDE
; |
62 | 58 |
63 private: | 59 private: |
64 GrSurface* fSurface; | 60 GrSurface* fSurface; |
65 bool fUnlock; // if true the pixel ref owns a texture cache lock on
fSurface | 61 bool fUnlock; // if true the pixel ref owns a texture cache lock on
fSurface |
66 | 62 |
67 typedef SkROLockPixelsPixelRef INHERITED; | 63 typedef SkROLockPixelsPixelRef INHERITED; |
68 }; | 64 }; |
69 | 65 |
70 #endif | 66 #endif |
OLD | NEW |