Bug 103079 - [EFL][WK2] MiniBrowser rendering should not get blurry when scrolled down with different scale values
Summary: [EFL][WK2] MiniBrowser rendering should not get blurry when scrolled down wit...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenneth Rohde Christiansen
URL:
Keywords:
Depends on:
Blocks: 103105
  Show dependency treegraph
 
Reported: 2012-11-22 09:33 PST by WebKit Review Bot
Modified: 2012-11-28 05:10 PST (History)
15 users (show)

See Also:


Attachments
Test case (6.74 KB, text/html)
2012-11-27 06:16 PST, Kenneth Rohde Christiansen
no flags Details
Patch (10.33 KB, patch)
2012-11-28 03:54 PST, Kenneth Rohde Christiansen
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description WebKit Review Bot 2012-11-22 09:33:58 PST
[EFL][WK2] MiniBrowser rendering gets blurry when scroll down with scale != 1.0
Requested by rafaelbrandao on #webkit.
Comment 1 Rafael Brandao 2012-11-22 09:35:42 PST
How to reproduce:
1. Run MiniBrowser on http://uol.com.br (or any other site that forces scale to be different than 1.0)
2. Observe the font rendered with this initial state.
3. Scroll down with mouse wheel once.
4. Now compare the font rendered with the previous state. There are differences.
Comment 2 Kenneth Rohde Christiansen 2012-11-22 09:40:33 PST
I can confirm this scrolling with the wheel. I also notice that at specific steps (say every 5 steps on google.com searching for 'hest') the text becomes clear again.
Comment 3 Rafael Brandao 2012-11-26 08:41:50 PST
I've found out so far that rendering the debugging lines (when using WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS=1) does not get blurry, while the repaint counter does (the rectangle and the number on it). Does this ring any bell? I'm still trying to understand how rendering works.
Comment 4 Kalyan 2012-11-26 19:49:57 PST
(In reply to comment #3)
> I've found out so far that rendering the debugging lines (when using WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS=1) does not get blurry, while the repaint counter does (the rectangle and the number on it). Does this ring any bell? I'm still trying to understand how rendering works.

Difference between two:

Debugging lines:
Debugging lines being drawn are nothing but quads with a line width and  particular color drawn using shaders. 

In case of repaintcounter:
We use an intermediate surface(cairo_image_surface) to draw the contents of repaint counter. The contents of surface are than copied into a texture.
Comment 5 Kenneth Rohde Christiansen 2012-11-27 05:59:33 PST
Description is wrong, it works fine with scale 0.5, 0.75, 0.80, and event 0.85, but a scale such as 0.86 triggers it though
Comment 6 Kenneth Rohde Christiansen 2012-11-27 06:05:01 PST
With scale 0.86 y pos 0 is sharp and so it y pos 200 and 400 (didn't test 300) - same with scale 0.81.

But with scale 0.816327 it is sharp at 0, 120, 240, 360
Comment 7 Rafael Brandao 2012-11-27 06:16:49 PST
(In reply to comment #6)
> With scale 0.86 y pos 0 is sharp and so it y pos 200 and 400 (didn't test 300) - same with scale 0.81.
> 
> But with scale 0.816327 it is sharp at 0, 120, 240, 360

Hm, *that* is interesting. :-)
Comment 8 Kenneth Rohde Christiansen 2012-11-27 06:16:50 PST
Created attachment 176253 [details]
Test case
Comment 9 Kenneth Rohde Christiansen 2012-11-27 06:31:22 PST
im wrong, changed scroll step to 1.

0.35: 0 looks fine, then 1 (off like 2 pixels), 2 (off like 1 pixel), 3 (perfect), etc.

0.816327: 

0 perfect
1 worse
2 worse
3 worse
4 better
5 better 
6 perfect
...
11 perfect

It looks like the same font is being painted on top with an offset
Comment 10 Kenneth Rohde Christiansen 2012-11-27 06:32:49 PST
At 0.90 every 10 steps are fine.
Comment 11 Kenneth Rohde Christiansen 2012-11-27 06:34:04 PST
Trick to scroll per 1 pixel, modify Source/WebKit2/Shared/efl/WebEventFactory.cpp

158     deltaX *= 1; //static_cast<float>(Scrollbar::pixelsPerLineStep());
159     deltaY *= 1; //static_cast<float>(Scrollbar::pixelsPerLineStep());
Comment 12 Kenneth Rohde Christiansen 2012-11-27 07:26:36 PST
It should be noted that while scrolling the tiles are not updated, so this is not a font issue AFAIK
Comment 13 Kenneth Rohde Christiansen 2012-11-27 08:10:26 PST
This seems to be from the fact that we send wheel events to the web process, it sends back css positions, which doesn't align to device pixels positions. Ie. we are told to move 10 css pixels but move 8.12339 instead with a scale of 0.812339.

Instead of storing css scroll position, we should store the page position, as we also want the user to pan page in device units in the near future.
Comment 14 Rafael Brandao 2012-11-27 11:51:37 PST
I will need to work on something else right now, Kenneth is almost there on this bug so please take it! :-)
Comment 15 Kenneth Rohde Christiansen 2012-11-28 03:54:14 PST
Created attachment 176449 [details]
Patch
Comment 16 Kenneth Rohde Christiansen 2012-11-28 05:10:47 PST
Landed in 136000