| 224 | } |
| 225 | |
| 226 | std::shared_ptr<TextureProxy> ProxyProvider::createTextureProxyByImageSource( |
| 227 | std::shared_ptr<DataSource<ImageBuffer>> source, int width, int height, bool alphaOnly, |
| 228 | bool mipmapped) { |
| 229 | auto format = alphaOnly ? PixelFormat::ALPHA_8 : PixelFormat::Unknown; |
| 230 | auto proxy = std::shared_ptr<TextureProxy>(new TextureProxy(width, height, format, mipmapped)); |
| 231 | addResourceProxy(proxy, {}); |
| 232 | auto task = |
| 233 | context->drawingBuffer()->make<TextureUploadTask>(proxy, std::move(source), mipmapped); |
| 234 | auto drawingManager = context->drawingManager(); |
| 235 | drawingManager->addResourceTask(std::move(task)); |
| 236 | drawingManager->addGenerateMipmapsTask(proxy); |
| 237 | return proxy; |
| 238 | } |
| 239 | |
| 240 | std::shared_ptr<TextureProxy> ProxyProvider::createTextureProxy( |
| 241 | std::shared_ptr<ImageBuffer> imageBuffer, bool mipmapped) { |
nothing calls this directly
no test coverage detected