|
38 | 38 | MsaaSampleCount sample_cnt, |
39 | 39 | SkColorType color_type, |
40 | 40 | sk_sp<SkColorSpace> color_space, |
41 | | - const SkSurfaceProps* props) { |
| 41 | + const SkSurfaceProps* props, |
| 42 | + SkSurface::TextureReleaseProc release_proc, |
| 43 | + SkSurface::ReleaseContext release_context) { |
42 | 44 | GrMtlTextureInfo info; |
43 | 45 | info.fTexture.reset([texture retain]); |
44 | 46 | GrBackendTexture backend_texture(texture.width, texture.height, GrMipmapped::kNo, info); |
45 | | - return SkSurface::MakeFromBackendTexture(context, backend_texture, origin, |
46 | | - static_cast<int>(sample_cnt), color_type, |
47 | | - std::move(color_space), props); |
| 47 | + return SkSurface::MakeFromBackendTexture( |
| 48 | + context, backend_texture, origin, static_cast<int>(sample_cnt), color_type, |
| 49 | + std::move(color_space), props, release_proc, release_context); |
48 | 50 | } |
49 | 51 | } // namespace |
50 | 52 |
|
|
137 | 139 | msaa_samples_, // sample count |
138 | 140 | kBGRA_8888_SkColorType, // color type |
139 | 141 | nullptr, // colorspace |
140 | | - nullptr // surface properties |
| 142 | + nullptr, // surface properties |
| 143 | + nullptr, // release proc |
| 144 | + nullptr // release context |
141 | 145 | ); |
142 | 146 |
|
143 | 147 | if (!surface) { |
|
203 | 207 | return nullptr; |
204 | 208 | } |
205 | 209 |
|
206 | | - sk_sp<SkSurface> surface = |
207 | | - CreateSurfaceFromMetalTexture(context_.get(), mtl_texture, kTopLeft_GrSurfaceOrigin, |
208 | | - msaa_samples_, kBGRA_8888_SkColorType, nullptr, nullptr); |
| 210 | + sk_sp<SkSurface> surface = CreateSurfaceFromMetalTexture( |
| 211 | + context_.get(), mtl_texture, kTopLeft_GrSurfaceOrigin, msaa_samples_, kBGRA_8888_SkColorType, |
| 212 | + nullptr, nullptr, static_cast<SkSurface::TextureReleaseProc>(texture.destruction_callback), |
| 213 | + texture.destruction_context); |
209 | 214 |
|
210 | 215 | if (!surface) { |
211 | 216 | FML_LOG(ERROR) << "Could not create the SkSurface from the metal texture."; |
|
0 commit comments