Chromium Code Reviews| 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 GrTexture* wrapBackendTexture(const GrBackendTextureDesc& desc, | 91 GrTexture* wrapBackendTexture(const GrBackendTextureDesc& desc, |
| 92 GrWrapOwnership = kBorrow_GrWrapOwnership); | 92 GrWrapOwnership = kBorrow_GrWrapOwnership); |
| 93 | 93 |
| 94 /** | 94 /** |
| 95 * Wraps an existing render target with a GrRenderTarget object. It is | 95 * Wraps an existing render target with a GrRenderTarget object. It is |
| 96 * similar to wrapBackendTexture but can be used to draw into surfaces | 96 * similar to wrapBackendTexture but can be used to draw into surfaces |
| 97 * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that | 97 * that are not also textures (e.g. FBO 0 in OpenGL, or an MSAA buffer that |
| 98 * the client will resolve to a texture). Currently wrapped render targets | 98 * the client will resolve to a texture). Currently wrapped render targets |
| 99 * always use the kBorrow_GrWrapOwnership semantics. | 99 * always use the kBorrow_GrWrapOwnership semantics. |
| 100 * | 100 * |
| 101 * @return GrTexture object or NULL on failure. | 101 * @return GrRenderTarget object or NULL on failure. |
| 102 */ | 102 */ |
| 103 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& de sc); | 103 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& de sc); |
| 104 | 104 |
| 105 /** | |
| 106 * Wraps an existing texture with a GrRenderTarget object. This is useful w hen the provided | |
| 107 * texture has a format that cannot be textured from by Skia, but we want t o raster to it. | |
| 108 * | |
| 109 * @return GrRenderTarget object or NULL on failure. | |
| 110 */ | |
| 111 GrRenderTarget* wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc & desc, | |
|
bsalomon
2016/02/22 16:41:01
Can we put this in GrResourceProvider (it's a deri
ericrk
2016/02/22 21:02:59
I was planning on calling this directly from Chrom
bsalomon
2016/02/23 02:25:27
Gotcha, what if we added a prepareForExternalIO (o
ericrk
2016/02/24 00:39:53
Added this function.
| |
| 112 GrWrapOwnership = kBorrow_ GrWrapOwnership); | |
| 113 | |
| 105 protected: | 114 protected: |
| 106 GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleO wner); | 115 GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleO wner); |
| 107 | 116 |
| 108 /** | 117 /** |
| 109 * Assigns a unique key to a resource. If the key is associated with another resource that | 118 * Assigns a unique key to a resource. If the key is associated with another resource that |
| 110 * association is removed and replaced by this resource. | 119 * association is removed and replaced by this resource. |
| 111 */ | 120 */ |
| 112 void assignUniqueKeyToResource(const GrUniqueKey&, GrGpuResource*); | 121 void assignUniqueKeyToResource(const GrUniqueKey&, GrGpuResource*); |
| 113 | 122 |
| 114 /** | 123 /** |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 163 |
| 155 private: | 164 private: |
| 156 GrResourceCache* fCache; | 165 GrResourceCache* fCache; |
| 157 GrGpu* fGpu; | 166 GrGpu* fGpu; |
| 158 | 167 |
| 159 // In debug builds we guard against improper thread handling | 168 // In debug builds we guard against improper thread handling |
| 160 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 169 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
| 161 }; | 170 }; |
| 162 | 171 |
| 163 #endif | 172 #endif |
| OLD | NEW |