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