From 67b2ae5932fb8057ea8b80762de950daf88b357f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 5 Mar 2024 09:11:13 -0500 Subject: [PATCH] gsk: Add a 'colorize' optimization flag We are going to add an optimization that turns color ops into colorize ops when beneficial. This flags will make it possible to turn that off with GSK_GPU_SKIP=colorize --- gsk/gpu/gskgpurenderer.c | 2 ++ gsk/gpu/gskgputypesprivate.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gsk/gpu/gskgpurenderer.c b/gsk/gpu/gskgpurenderer.c index a74216eb9a..c92b55b1f1 100644 --- a/gsk/gpu/gskgpurenderer.c +++ b/gsk/gpu/gskgpurenderer.c @@ -31,7 +31,9 @@ static const GdkDebugKey gsk_gpu_optimization_keys[] = { { "gradients", GSK_GPU_OPTIMIZE_GRADIENTS, "Don't supersample gradients" }, { "mipmap", GSK_GPU_OPTIMIZE_MIPMAP, "Avoid creating mipmaps" }, { "glyph-align", GSK_GPU_OPTIMIZE_GLYPH_ALIGN, "Never align glyphs to the subpixel grid" }, + { "colorize", GSK_GPU_OPTIMIZE_COLORIZE, "Don't replace color by colorize" }, + /* These require hardware support */ { "gl-baseinstance", GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE, "Assume no ARB/EXT_base_instance support" }, }; diff --git a/gsk/gpu/gskgputypesprivate.h b/gsk/gpu/gskgputypesprivate.h index a3f6c1d159..8573323bfb 100644 --- a/gsk/gpu/gskgputypesprivate.h +++ b/gsk/gpu/gskgputypesprivate.h @@ -119,7 +119,9 @@ typedef enum { GSK_GPU_OPTIMIZE_GRADIENTS = 1 << 4, GSK_GPU_OPTIMIZE_MIPMAP = 1 << 5, GSK_GPU_OPTIMIZE_GLYPH_ALIGN = 1 << 6, + GSK_GPU_OPTIMIZE_COLORIZE = 1 << 7, + /* These require hardware support */ - GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE = 1 << 7, + GSK_GPU_OPTIMIZE_GL_BASE_INSTANCE = 1 << 16, } GskGpuOptimizations;