mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
Refactor library fragment shaders (GLSL, MSL, WGSL) to extract _hb_gpu_decode_glyph and _hb_gpu_curve_counts helpers, used by both hb_gpu_render and the debug visualization. Debug mode (d key) shows per-pixel curve counts as a heatmap: R = horizontal band curves, G = vertical band curves, B = text coverage. Scale 0-8 curves maps to 0-1 intensity. Also auto-generates demo shader headers via meson, and adds set_debug to the renderer interface. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
1.5 KiB
Meson
55 lines
1.5 KiB
Meson
gpu_demo_shader_sources = [
|
|
['demo-fragment.glsl', 'demo-fragment-glsl.hh', 'demo_fragment_glsl'],
|
|
['demo-vertex.glsl', 'demo-vertex-glsl.hh', 'demo_vertex_glsl'],
|
|
]
|
|
|
|
gpu_demo_shader_headers = []
|
|
foreach s : gpu_demo_shader_sources
|
|
gpu_demo_shader_headers += custom_target('gpu-demo-@0@'.format(s[1]),
|
|
input: s[0],
|
|
output: s[1],
|
|
command: [find_program('python3'), meson.project_source_root() / 'src' / 'gen-gpu-shader-artifacts.py',
|
|
'@OUTPUT@', meson.current_source_dir(), '@INPUT@'],
|
|
)
|
|
endforeach
|
|
|
|
gpu_demo_sources = files(
|
|
'demo-atlas.h',
|
|
'demo-atlas.cc',
|
|
'demo-buffer.h',
|
|
'demo-buffer.cc',
|
|
'demo-common.h',
|
|
'demo-font.h',
|
|
'demo-font.cc',
|
|
'demo-glstate.h',
|
|
'demo-glstate.cc',
|
|
'demo-renderer.h',
|
|
'demo-renderer-gl.cc',
|
|
'demo-shader.h',
|
|
'demo-shader.cc',
|
|
'demo-view.h',
|
|
'demo-view.cc',
|
|
'default-text-en.hh',
|
|
'default-text-fa.hh',
|
|
'default-font.hh',
|
|
'matrix4x4.hh',
|
|
'trackball.hh',
|
|
)
|
|
|
|
if host_machine.system() == 'darwin'
|
|
gpu_demo_sources += files(
|
|
'demo-metal.mm',
|
|
)
|
|
endif
|
|
|
|
glew_dep = dependency('glew', required: false)
|
|
glfw_dep = dependency('glfw3', required: false)
|
|
if host_machine.system() == 'darwin'
|
|
gl_dep = dependency('appleframeworks', modules: ['OpenGL'], required: false)
|
|
metal_dep = dependency('appleframeworks', modules: ['Metal', 'QuartzCore', 'Foundation', 'AppKit'], required: false)
|
|
else
|
|
gl_dep = dependency('gl', required: false)
|
|
metal_dep = disabler()
|
|
endif
|
|
have_gpu_demo_deps = glew_dep.found() and glfw_dep.found() and gl_dep.found()
|