refactor(new_editor): unify d3d12 text run caching
This commit is contained in:
@@ -20,6 +20,14 @@ namespace XCEngine::UI::Editor::Host {
|
||||
|
||||
class D3D12UiTextSystem final : public ::XCEngine::UI::Editor::UIEditorTextMeasurer {
|
||||
public:
|
||||
struct RasterizedTextRun {
|
||||
std::vector<std::uint8_t> rgbaPixels = {};
|
||||
UINT width = 0u;
|
||||
UINT height = 0u;
|
||||
float offsetX = 0.0f;
|
||||
float offsetY = 0.0f;
|
||||
};
|
||||
|
||||
struct ShapedGlyph {
|
||||
Microsoft::WRL::ComPtr<IDWriteFontFace> fontFace = {};
|
||||
std::uint16_t glyphIndex = 0u;
|
||||
@@ -67,9 +75,7 @@ public:
|
||||
bool RasterizeTextMask(
|
||||
std::string_view text,
|
||||
float fontSize,
|
||||
std::vector<std::uint8_t>& outRgbaPixels,
|
||||
UINT& outWidth,
|
||||
UINT& outHeight,
|
||||
RasterizedTextRun& outRun,
|
||||
std::string& outError);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user