| 340 | } |
| 341 | |
| 342 | std::shared_ptr<TextureProxy> ProxyProvider::wrapExternalTexture( |
| 343 | const BackendTexture& backendTexture, ImageOrigin origin, bool adopted) { |
| 344 | auto textureView = TextureView::MakeFrom(context, backendTexture, origin, adopted); |
| 345 | if (textureView == nullptr) { |
| 346 | return nullptr; |
| 347 | } |
| 348 | auto format = context->gpu()->getExternalTextureFormat(backendTexture); |
| 349 | auto proxy = std::shared_ptr<TextureProxy>( |
| 350 | new TextureProxy(textureView->width(), textureView->height(), format, |
| 351 | textureView->hasMipmaps(), textureView->origin())); |
| 352 | proxy->resource = std::move(textureView); |
| 353 | addResourceProxy(proxy); |
| 354 | return proxy; |
| 355 | } |
| 356 | |
| 357 | std::shared_ptr<RenderTargetProxy> ProxyProvider::createRenderTargetProxy( |
| 358 | const BackendTexture& backendTexture, int sampleCount, ImageOrigin origin, bool adopted) { |
no test coverage detected