gpu: Take color state into account for glyph lookup
Add a 'linear' bit to the glyph cache key, so we can get have separate cached images for the two cases. Note that the image tagging with color state is ignored here - we simply copy the glyph image out of the atlas as-is, and rely on the cache to give use the right color state.
This commit is contained in:
@@ -977,6 +977,7 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
|
||||
gsk_gpu_upload_glyph_op (frame,
|
||||
cache->image,
|
||||
(flags & GSK_GPU_GLYPH_LINEAR) != 0,
|
||||
scaled_font,
|
||||
glyph,
|
||||
&(cairo_rectangle_int_t) {
|
||||
|
||||
@@ -88,7 +88,8 @@ typedef enum
|
||||
GSK_GPU_GLYPH_X_OFFSET_3 = 0x3,
|
||||
GSK_GPU_GLYPH_Y_OFFSET_1 = 0x4,
|
||||
GSK_GPU_GLYPH_Y_OFFSET_2 = 0x8,
|
||||
GSK_GPU_GLYPH_Y_OFFSET_3 = 0xC
|
||||
GSK_GPU_GLYPH_Y_OFFSET_3 = 0xC,
|
||||
GSK_GPU_GLYPH_LINEAR = 0x10,
|
||||
} GskGpuGlyphLookupFlags;
|
||||
|
||||
GskGpuImage * gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
||||
|
||||
@@ -3185,6 +3185,9 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self,
|
||||
glyph_origin.x *= inv_align_scale_x;
|
||||
glyph_origin.y *= inv_align_scale_y;
|
||||
|
||||
if (gdk_color_state_is_linear (self->color_state))
|
||||
flags |= GSK_GPU_GLYPH_LINEAR;
|
||||
|
||||
image = gsk_gpu_device_lookup_glyph_image (device,
|
||||
self->frame,
|
||||
font,
|
||||
|
||||
Reference in New Issue
Block a user