MCPcopy Create free account
hub / github.com/Tencent/tgfx / createTextureProxyByImageSource

Method createTextureProxyByImageSource

src/gpu/ProxyProvider.cpp:226–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226std::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
240std::shared_ptr<TextureProxy> ProxyProvider::createTextureProxy(
241 std::shared_ptr<ImageBuffer> imageBuffer, bool mipmapped) {

Callers

nothing calls this directly

Calls 4

drawingManagerMethod · 0.80
addResourceTaskMethod · 0.80
drawingBufferMethod · 0.45

Tested by

no test coverage detected