mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 16:01:07 +01:00
hb-raster: move draw-specific types from .hh to hb-raster-draw.cc
Move hb_raster_edge_t and hb_raster_draw_t struct definitions into hb-raster-draw.cc since they are only used there. hb-raster.hh now contains only hb_raster_image_t, shared between the two .cc files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
65c16d7472
commit
a089a19c76
2 files changed
+35
-34
No files matched your search
@@ -27,6 +27,7 @@
|
||||
#include "hb.hh"
|
||||
|
||||
#include "hb-raster.hh"
|
||||
#include "hb-geometry.hh"
|
||||
#include "hb-machinery.hh"
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
@@ -38,6 +39,40 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Normalized edge: yH > yL always */
|
||||
struct hb_raster_edge_t
|
||||
{
|
||||
int32_t xL, yL; /* lower endpoint (26.6) */
|
||||
int32_t xH, yH; /* upper endpoint (26.6) */
|
||||
int64_t slope; /* dx/dy in 16.16 fixed point: ((int64_t)dx << 16) / dy */
|
||||
int32_t wind; /* +1 or -1 */
|
||||
};
|
||||
|
||||
/* hb_raster_draw_t — outline rasterizer */
|
||||
struct hb_raster_draw_t
|
||||
{
|
||||
hb_object_header_t header;
|
||||
|
||||
/* Configuration */
|
||||
hb_raster_format_t format = HB_RASTER_FORMAT_A8;
|
||||
hb_transform_t<> transform = {1, 0, 0, 1, 0, 0};
|
||||
hb_raster_extents_t fixed_extents = {};
|
||||
bool has_fixed_extents = false;
|
||||
|
||||
/* Accumulated geometry */
|
||||
hb_vector_t<hb_raster_edge_t> edges;
|
||||
|
||||
/* Scratch — reused across render() calls */
|
||||
hb_vector_t<int32_t> row_area;
|
||||
hb_vector_t<int16_t> row_cover;
|
||||
hb_vector_t<hb_vector_t<unsigned>> edge_buckets;
|
||||
hb_vector_t<unsigned> active_edges;
|
||||
|
||||
/* Recycled image for zero-malloc render */
|
||||
hb_raster_image_t *recycled_image = nullptr;
|
||||
};
|
||||
|
||||
|
||||
/* hb_raster_draw_t */
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,20 +29,10 @@
|
||||
|
||||
#include "hb.hh"
|
||||
#include "hb-raster.h"
|
||||
#include "hb-geometry.hh"
|
||||
#include "hb-object.hh"
|
||||
#include "hb-vector.hh"
|
||||
|
||||
|
||||
/* Normalized edge: yH > yL always */
|
||||
struct hb_raster_edge_t
|
||||
{
|
||||
int32_t xL, yL; /* lower endpoint (26.6) */
|
||||
int32_t xH, yH; /* upper endpoint (26.6) */
|
||||
int64_t slope; /* dx/dy in 16.16 fixed point: ((int64_t)dx << 16) / dy */
|
||||
int32_t wind; /* +1 or -1 */
|
||||
};
|
||||
|
||||
/* hb_raster_image_t — pixel artifact */
|
||||
struct hb_raster_image_t
|
||||
{
|
||||
@@ -53,29 +43,5 @@ struct hb_raster_image_t
|
||||
hb_raster_format_t format = HB_RASTER_FORMAT_A8;
|
||||
};
|
||||
|
||||
/* hb_raster_draw_t — outline rasterizer */
|
||||
struct hb_raster_draw_t
|
||||
{
|
||||
hb_object_header_t header;
|
||||
|
||||
/* Configuration */
|
||||
hb_raster_format_t format = HB_RASTER_FORMAT_A8;
|
||||
hb_transform_t<> transform = {1, 0, 0, 1, 0, 0};
|
||||
hb_raster_extents_t fixed_extents = {};
|
||||
bool has_fixed_extents = false;
|
||||
|
||||
/* Accumulated geometry */
|
||||
hb_vector_t<hb_raster_edge_t> edges;
|
||||
|
||||
/* Scratch — reused across render() calls */
|
||||
hb_vector_t<int32_t> row_area;
|
||||
hb_vector_t<int16_t> row_cover;
|
||||
hb_vector_t<hb_vector_t<unsigned>> edge_buckets;
|
||||
hb_vector_t<unsigned> active_edges;
|
||||
|
||||
/* Recycled image for zero-malloc render */
|
||||
hb_raster_image_t *recycled_image = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif /* HB_RASTER_HH */
|
||||
Reference in new issue
Block a user