| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrTextureProvider_DEFINED | 8 #ifndef GrTextureProvider_DEFINED |
| 9 #define GrTextureProvider_DEFINED | 9 #define GrTextureProvider_DEFINED |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Wrapped Backend Surfaces | 91 // Wrapped Backend Surfaces |
| 92 | 92 |
| 93 /** | 93 /** |
| 94 * Wraps an existing texture with a GrTexture object. | 94 * Wraps an existing texture with a GrTexture object. |
| 95 * | 95 * |
| 96 * OpenGL: if the object is a texture Gr may change its GL texture params | 96 * OpenGL: if the object is a texture Gr may change its GL texture params |
| 97 * when it is drawn. | 97 * when it is drawn. |
| 98 * | 98 * |
| 99 * @return GrTexture object or NULL on failure. | 99 * @return GrTexture object or NULL on failure. |
| 100 */ | 100 */ |
| 101 GrTexture* wrapBackendTexture(const GrBackendTextureDesc& desc, | 101 sk_sp<GrTexture> wrapBackendTexture(const GrBackendTextureDesc& desc, |
| 102 GrWrapOwnership = kBorrow_GrWrapOwnership); | 102 GrWrapOwnership = kBorrow_GrWrapOwnershi
p); |
| 103 | 103 |
| 104 /** | 104 /** |
| 105 * Wraps an existing render target with a GrRenderTarget object. It is | 105 * Wraps an existing render target with a GrRenderTarget object. It is |
| 106 * similar to wrapBackendTexture but can be used to draw into surfaces | 106 * similar to wrapBackendTexture but can be used to draw into surfaces |
| 107 * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that | 107 * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that |
| 108 * the client will resolve to a texture). Currently wrapped render targets | 108 * the client will resolve to a texture). Currently wrapped render targets |
| 109 * always use the kBorrow_GrWrapOwnership semantics. | 109 * always use the kBorrow_GrWrapOwnership semantics. |
| 110 * | 110 * |
| 111 * @return GrRenderTarget object or NULL on failure. | 111 * @return GrRenderTarget object or NULL on failure. |
| 112 */ | 112 */ |
| 113 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& de
sc); | 113 sk_sp<GrRenderTarget> wrapBackendRenderTarget(const GrBackendRenderTargetDe
sc& desc); |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleO
wner); | 116 GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleO
wner); |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * Assigns a unique key to a resource. If the key is associated with another
resource that | 119 * Assigns a unique key to a resource. If the key is associated with another
resource that |
| 120 * association is removed and replaced by this resource. | 120 * association is removed and replaced by this resource. |
| 121 */ | 121 */ |
| 122 void assignUniqueKeyToResource(const GrUniqueKey&, GrGpuResource*); | 122 void assignUniqueKeyToResource(const GrUniqueKey&, GrGpuResource*); |
| 123 | 123 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 private: | 165 private: |
| 166 GrResourceCache* fCache; | 166 GrResourceCache* fCache; |
| 167 GrGpu* fGpu; | 167 GrGpu* fGpu; |
| 168 | 168 |
| 169 // In debug builds we guard against improper thread handling | 169 // In debug builds we guard against improper thread handling |
| 170 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 170 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 #endif | 173 #endif |
| OLD | NEW |