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

Function ComputeTextureScratchKey

src/gpu/resources/TextureView.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static ScratchKey ComputeTextureScratchKey(int width, int height, PixelFormat format,
50 bool mipmapped) {
51 static const uint32_t DefaultTextureType = UniqueID::Next();
52 BytesKey bytesKey(4);
53 bytesKey.write(DefaultTextureType);
54 bytesKey.write(width);
55 bytesKey.write(height);
56 auto formatValue = static_cast<uint32_t>(format);
57 auto mipmapValue = static_cast<uint32_t>(mipmapped ? 1 : 0);
58 bytesKey.write(formatValue | (mipmapValue << 30));
59 return bytesKey;
60}
61
62std::shared_ptr<TextureView> TextureView::MakeFormat(Context* context, int width, int height,
63 const void* pixels, size_t rowBytes,

Callers 2

MakeFormatMethod · 0.85
MakeFromMethod · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected