diff --git a/gsk/gpu/gskgldevice.c b/gsk/gpu/gskgldevice.c index 4d7a4cc530..92567970c5 100644 --- a/gsk/gpu/gskgldevice.c +++ b/gsk/gpu/gskgldevice.c @@ -119,7 +119,7 @@ gsk_gl_device_create_atlas_image (GskGpuDevice *device, GskGLDevice *self = GSK_GL_DEVICE (device); return gsk_gl_image_new (self, - GDK_MEMORY_R8G8B8A8_PREMULTIPLIED, + GDK_MEMORY_DEFAULT, GSK_GPU_IMAGE_RENDERABLE, width, height); diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index df512cc843..6c847c6e17 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -3020,7 +3020,7 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self, glyph_offset = GRAPHENE_POINT_INIT (offset.x - glyph_offset.x * inv_scale + (float) glyphs[i].geometry.x_offset / PANGO_SCALE, offset.y - glyph_offset.y * inv_scale + (float) glyphs[i].geometry.y_offset / PANGO_SCALE); descriptor = gsk_gpu_node_processor_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT); - if (gsk_text_node_has_color_glyphs (node)) + if (glyphs[i].attr.is_color) gsk_gpu_texture_op (self->frame, gsk_gpu_clip_get_shader_clip (&self->clip, &glyph_offset, &glyph_bounds), self->desc, diff --git a/testsuite/gsk/compare/text-mixed-color-nocairo.node b/testsuite/gsk/compare/text-mixed-color-nocairo.node new file mode 100644 index 0000000000..db43dc1797 --- /dev/null +++ b/testsuite/gsk/compare/text-mixed-color-nocairo.node @@ -0,0 +1,7 @@ +transform { + transform: translate(0, 100); + child: text { + font: "text-mixed-color 20"; + glyphs: 1 20, 2 20, 3 20, 4 20 0 0 color, 5 20 0 0 color, 6 20 0 0 color; + } +} diff --git a/testsuite/gsk/compare/text-mixed-color-nocairo.png b/testsuite/gsk/compare/text-mixed-color-nocairo.png new file mode 100644 index 0000000000..adfcfdf6b1 Binary files /dev/null and b/testsuite/gsk/compare/text-mixed-color-nocairo.png differ diff --git a/testsuite/gsk/fonts/fonts.conf b/testsuite/gsk/fonts/fonts.conf new file mode 100644 index 0000000000..26d218edd9 --- /dev/null +++ b/testsuite/gsk/fonts/fonts.conf @@ -0,0 +1,7 @@ + + + + /tmp/cache + . + /etc/fonts/fonts.conf + diff --git a/testsuite/gsk/fonts/text-mixed-color.ttf b/testsuite/gsk/fonts/text-mixed-color.ttf new file mode 100644 index 0000000000..b875433905 Binary files /dev/null and b/testsuite/gsk/fonts/text-mixed-color.ttf differ diff --git a/testsuite/gsk/fonts/text-mixed-color.ttx b/testsuite/gsk/fonts/text-mixed-color.ttx new file mode 100644 index 0000000000..deaf81f104 --- /dev/null +++ b/testsuite/gsk/fonts/text-mixed-color.ttx @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text-mixed-color + + + + + + + + + + + + + + + + + + diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index e847e07711..c29be8d081 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -134,6 +134,7 @@ compare_render_tests = [ 'stroke-fractional-translate-nogl', 'stroke-opacity', 'stroke-with-3d-contents-nogl-nocairo', + 'text-mixed-color-nocairo', 'texture-coords', 'texture-scale-filters-nocairo', 'texture-scale-magnify-10000x', @@ -201,7 +202,8 @@ foreach renderer : renderers 'GSK_RENDERER=' + renderer_name, 'GTK_A11Y=test', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), - 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()) + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + 'FONTCONFIG_FILE=@0@/fonts/fonts.conf'.format(meson.current_source_dir()) ] if ((not testname.contains(exclude_term)) and