Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@k-takata
Copy link
Member

@k-takata k-takata commented Dec 2, 2017

Hi,

This pull-request is a supplemental patch for #2375 (v8.0.1343).
This introduces some performance improvements and fixes a bug:

  • Improve performance when underlines, strikethroughs or undercurls are used.
    v8.0.1343 uses GDI to draw these lines, however, switching between DirectX and GDI causes terrible slowdown.
    This PR uses Direct2D APIs to draw the lines.

  • Improve performance when GDI fallback occurs by using a raster font.
    This PR draws texts on top of a Direct2D surface even if a raster font is selected.

  • Add 'scrlines' suboption to the 'rop' option for performance tuning.
    On some environments, redrawing is faster than scrolling. (On my environment, redrawing is about 2x faster.)
    Users can optimize scrolling behavior by using this suboption.

  • Fix a bug that the 'mFallbackDC' variable was not properly updated.
    See the following URL for the change: vim-jp@080e932

This PR was written by koron and me, and also reviewed by mattn.

k-takata and others added 23 commits November 27, 2017 22:51
Add wrapper functions for DrawLine and SetPixel.
* Do not switch between GDI and Direct2D if not really needed.
  - Implement both GDI and D2D version of FillRect and DrawLine.
Use DrawLine in Direct2D mode instead of SetPixel.
introduce DrawingMode to reduce switching
It seems that redrawing is much faster than scrolling when DirectX is
used.
Make it customizable whether ScrollWindowEx or RedrawWindow is used.
Need to recreate the render taget when the error is returned.
Most part is written by koron.
It should be called when the cursor should be updated.
Recreate mRT after EndDraw() returns D2DERR_RECREATE_TARGET.
@k-takata k-takata deleted the improve-color-emoji branch December 5, 2017 13:36
adizero pushed a commit to adizero/vim that referenced this pull request May 19, 2018
…pdated

Problem:    MS-Windows: drawing underline, curl and strike-throw is slow,
            mFallbackDC not properly updated.
Solution:   Several performance improvements. (Ken Takata, Taro Muraoka,
            Yasuhiro Matsumoto, closes vim#2401)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants