OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkSpecialSurface_DEFINED | 8 #ifndef SkSpecialSurface_DEFINED |
9 #define SkSpecialSurface_DEFINED | 9 #define SkSpecialSurface_DEFINED |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 * surface. | 38 * surface. |
39 * | 39 * |
40 * The canvas will be invalid after 'newImageSnapshot' is called. | 40 * The canvas will be invalid after 'newImageSnapshot' is called. |
41 */ | 41 */ |
42 SkCanvas* getCanvas(); | 42 SkCanvas* getCanvas(); |
43 | 43 |
44 /** | 44 /** |
45 * Returns an image of the current state of the surface pixels up to this | 45 * Returns an image of the current state of the surface pixels up to this |
46 * point. The canvas returned by 'getCanvas' becomes invalidated by this | 46 * point. The canvas returned by 'getCanvas' becomes invalidated by this |
47 * call and no more drawing to this surface is allowed. | 47 * call and no more drawing to this surface is allowed. |
| 48 * |
| 49 * Note: the caller inherits a ref from this call that must be balanced |
48 */ | 50 */ |
49 SkSpecialImage* newImageSnapshot(); | 51 SkSpecialImage* newImageSnapshot(); |
50 | 52 |
51 /** | 53 /** |
52 * Use an existing (renderTarget-capable) GrTexture as the backing store. | 54 * Use an existing (renderTarget-capable) GrTexture as the backing store. |
53 */ | 55 */ |
54 static SkSpecialSurface* NewFromTexture(const SkIRect& subset, GrTexture*, | 56 static SkSpecialSurface* NewFromTexture(const SkIRect& subset, GrTexture*, |
55 const SkSurfaceProps* = nullptr); | 57 const SkSurfaceProps* = nullptr); |
56 | 58 |
57 /** | 59 /** |
(...skipping 26 matching lines...) Expand all Loading... |
84 const SkIRect& subset() const { return fSubset; } | 86 const SkIRect& subset() const { return fSubset; } |
85 | 87 |
86 private: | 88 private: |
87 const SkSurfaceProps fProps; | 89 const SkSurfaceProps fProps; |
88 const SkIRect fSubset; | 90 const SkIRect fSubset; |
89 | 91 |
90 typedef SkRefCnt INHERITED; | 92 typedef SkRefCnt INHERITED; |
91 }; | 93 }; |
92 | 94 |
93 #endif | 95 #endif |
OLD | NEW |