https://bugs.documentfoundation.org/show_bug.cgi?id=162263

--- Comment #16 from Patrick Luby (volunteer) <[email protected]> ---
(In reply to Patrick Luby (volunteer) from comment #15)
> Created attachment 195687 [details]
> Snapshot of sidebar character color toolbar buttons in sidebar
> 
> The top icons are a snapshot of LibreOffice 28.0 RC (zoomed in) and the
> bottom icons are a snapshot of my local build (also zoomed in) with the
> debug patch in attachment #195686 [details].

So I found the code that causes the character color icons in the sidebar to be
blurry: its ToolboxButtonColorUpdaterBase::Update() that adds the color
rectangle at the bottom of the icon.

I disabled that code completely in my debug patch in attachment #195686. With
that debug patch you can see the original, unmodified icons in the bottom of
attachment #195687 are much higher resolution.

I read the code in ToolboxButtonColorUpdaterBase::Update() and here is what I
think is happening:

1. Before ToolboxButtonColorUpdaterBase::Update() is called, the correct SVG
icon is rasterized to a "double sized" width and height bitmap.

2. Somewhere else in the LibreOffice code, the SVG icon is converted to a
regular (i.e. not "double sized") PNG image that is saved in a disk cache.

3. ToolboxButtonColorUpdaterBase::Update() is called and it calls
vcl::CommandInfoProvider::GetXGraphicForCommand() to load the lower resolution
PNG file from the disk cache.

4. The lower resolution PNG file and the color rectangle are drawn to a drawing
surface and a bitmap is extracted from the drawing surface. This new image
replaces the higher resolution bitmap created in step 1 above.

I am not familiar with the PNG disk caching code so I'm not sure how this can
be fixed. My first guess is that the PNG cache needs to either be ignored or
should cache "double sized" PNG files. However, I have feeling that that would
also require code to downscale the "double sized" PNG files in
ToolboxButtonColorUpdaterBase::Update() and probably elsewhere in the
LibreOffice code.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to