| 355 | } |
| 356 | |
| 357 | std::shared_ptr<RenderTargetProxy> ProxyProvider::createRenderTargetProxy( |
| 358 | const BackendTexture& backendTexture, int sampleCount, ImageOrigin origin, bool adopted) { |
| 359 | auto format = context->gpu()->getExternalTextureFormat(backendTexture); |
| 360 | if (format == PixelFormat::Unknown) { |
| 361 | return nullptr; |
| 362 | } |
| 363 | auto caps = context->caps(); |
| 364 | if (!caps->isFormatRenderable(format)) { |
| 365 | return nullptr; |
| 366 | } |
| 367 | sampleCount = caps->getSampleCount(sampleCount, format); |
| 368 | auto proxy = std::shared_ptr<TextureRenderTargetProxy>( |
| 369 | new ExternalTextureRenderTargetProxy(backendTexture, format, sampleCount, origin, adopted)); |
| 370 | addResourceProxy(proxy); |
| 371 | return proxy; |
| 372 | } |
| 373 | |
| 374 | std::shared_ptr<RenderTargetProxy> ProxyProvider::createRenderTargetProxy( |
| 375 | HardwareBufferRef hardwareBuffer, int sampleCount) { |
no test coverage detected