OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkImagePriv_DEFINED | 8 #ifndef SkImagePriv_DEFINED |
9 #define SkImagePriv_DEFINED | 9 #define SkImagePriv_DEFINED |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // budget or not. | 70 // budget or not. |
71 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); | 71 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); |
72 | 72 |
73 // Update the texture wrapped by an image created with NewTexture. This | 73 // Update the texture wrapped by an image created with NewTexture. This |
74 // is called when a surface and image share the same GrTexture and the | 74 // is called when a surface and image share the same GrTexture and the |
75 // surface needs to perform a copy-on-write | 75 // surface needs to perform a copy-on-write |
76 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 76 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
77 | 77 |
78 GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted); | 78 GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted); |
79 | 79 |
| 80 /** |
| 81 * Will attempt to upload and lock the contents of the image as a texture, so t
hat subsequent |
| 82 * draws to a gpu-target will come from that texture (and not by looking at the
original image |
| 83 * src). In particular this is intended to use the texture even if the image's
original content |
| 84 * changes subsequent to this call (i.e. the src is mutable!). |
| 85 * |
| 86 * This must be balanced by an equal number of calls to SkImage_unpinAsTexture(
) -- calls can be |
| 87 * nested. |
| 88 * |
| 89 * Once in this "pinned" state, the image has all of the same thread restrictio
ns that exist |
| 90 * for a natively created gpu image (e.g. SkImage::MakeFromTexture) |
| 91 * - all drawing, pinning, unpinning must happen in the same thread as the GrCo
ntext. |
| 92 */ |
| 93 void SkImage_pinAsTexture(const SkImage*, GrContext*); |
| 94 |
| 95 /** |
| 96 * The balancing call to SkImage_pinAsTexture. When a balanced number of calls
have been made, then |
| 97 * the "pinned" texture is free to be purged, etc. This also means that a subse
quent "pin" call |
| 98 * will look at the original content again, and if its uniqueID/generationID ha
s changed, then |
| 99 * a newer texture will be uploaded/pinned. |
| 100 * |
| 101 * The context passed to unpin must match the one passed to pin. |
| 102 */ |
| 103 void SkImage_unpinAsTexture(const SkImage*, GrContext*); |
| 104 |
80 #endif | 105 #endif |
OLD | NEW |