Menu

#1400 Automatic turn off buffered drawing for Direct2D

Committed
closed
5
2021-07-26
2021-03-16
Zufu Liu
No

With current code and document

Since Direct2D buffers drawing, Scintilla's buffering can be turned off with SCI_SETBUFFEREDDRAW(0).

application currently will need following steps to proper set buffered drawing:

SCI_SETTECHNOLOGY(technology)
technology = SCI_GETTECHNOLOGY();
SCI_SETBUFFEREDDRAW(technology == SC_TECHNOLOGY_DEFAULT);

with one line addition in case SCI_SETTECHNOLOGY:, there is no need to call SCI_SETBUFFEREDDRAW:

#if defined(USE_D2D)
    DropRenderTarget();
    view.bufferedDraw = technologyNew == SC_TECHNOLOGY_DEFAULT;
#endif

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-04-02

    This sets buffered draw on for SC_TECHNOLOGY_DEFAULT which seems reasonable in most cases but could defeat the intention of applications that, when using GDI, prefer no buffering, perhaps using the old single phase drawing path.

    They do have to have had Direct2D turned on, then switch back to GDI for this to be a problem, so it would not be common. May just need documentation: switching technology may reset other settings (buffering, drawing phases, ...) so other modes should be set if desired.

     
  • Neil Hodgson

    Neil Hodgson - 2021-06-25
    • labels: --> scintilla, win32
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2021-06-25

    Committed as [d5a2f0].

     

    Related

    Commit: [d5a2f0]

  • Neil Hodgson

    Neil Hodgson - 2021-07-26
    • status: open --> closed
     
  • Neil Hodgson

    Neil Hodgson - 2021-07-26

    Committed as [d5a2f0].

     

    Related

    Commit: [d5a2f0]


Log in to post a comment.

MongoDB Logo MongoDB