Patch [ 877891 ] Share the DC from DoPaint with FullPaint in ScintillaWX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -528,7 +528,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
|
|||||||
delete surfaceWindow;
|
delete surfaceWindow;
|
||||||
if (paintState == paintAbandoned) {
|
if (paintState == paintAbandoned) {
|
||||||
// Painting area was insufficient to cover new styling or brace highlight positions
|
// Painting area was insufficient to cover new styling or brace highlight positions
|
||||||
FullPaint();
|
FullPaint(dc);
|
||||||
}
|
}
|
||||||
paintState = notPainting;
|
paintState = notPainting;
|
||||||
}
|
}
|
||||||
@@ -833,18 +833,18 @@ void ScintillaWX::DoDragLeave() {
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// Redraw all of text area. This paint will not be abandoned.
|
// Redraw all of text area. This paint will not be abandoned.
|
||||||
void ScintillaWX::FullPaint() {
|
void ScintillaWX::FullPaint(wxDC *dc) {
|
||||||
|
wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint"));
|
||||||
paintState = painting;
|
paintState = painting;
|
||||||
rcPaint = GetClientRectangle();
|
rcPaint = GetClientRectangle();
|
||||||
paintingAllText = true;
|
paintingAllText = true;
|
||||||
wxClientDC dc(stc);
|
|
||||||
Surface* surfaceWindow = Surface::Allocate();
|
Surface* surfaceWindow = Surface::Allocate();
|
||||||
surfaceWindow->Init(&dc, wMain.GetID());
|
surfaceWindow->Init(dc, wMain.GetID());
|
||||||
|
|
||||||
dc.BeginDrawing();
|
dc->BeginDrawing();
|
||||||
ClipChildren(dc, rcPaint);
|
ClipChildren(*dc, rcPaint);
|
||||||
Paint(surfaceWindow, rcPaint);
|
Paint(surfaceWindow, rcPaint);
|
||||||
dc.EndDrawing();
|
dc->EndDrawing();
|
||||||
|
|
||||||
delete surfaceWindow;
|
delete surfaceWindow;
|
||||||
paintState = notPainting;
|
paintState = notPainting;
|
||||||
|
@@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
void FullPaint();
|
void FullPaint(wxDC *dc);
|
||||||
bool CanPaste();
|
bool CanPaste();
|
||||||
bool GetHideSelection() { return hideSelection; }
|
bool GetHideSelection() { return hideSelection; }
|
||||||
void DoScrollToLine(int line);
|
void DoScrollToLine(int line);
|
||||||
|
@@ -528,7 +528,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
|
|||||||
delete surfaceWindow;
|
delete surfaceWindow;
|
||||||
if (paintState == paintAbandoned) {
|
if (paintState == paintAbandoned) {
|
||||||
// Painting area was insufficient to cover new styling or brace highlight positions
|
// Painting area was insufficient to cover new styling or brace highlight positions
|
||||||
FullPaint();
|
FullPaint(dc);
|
||||||
}
|
}
|
||||||
paintState = notPainting;
|
paintState = notPainting;
|
||||||
}
|
}
|
||||||
@@ -833,18 +833,18 @@ void ScintillaWX::DoDragLeave() {
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// Redraw all of text area. This paint will not be abandoned.
|
// Redraw all of text area. This paint will not be abandoned.
|
||||||
void ScintillaWX::FullPaint() {
|
void ScintillaWX::FullPaint(wxDC *dc) {
|
||||||
|
wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint"));
|
||||||
paintState = painting;
|
paintState = painting;
|
||||||
rcPaint = GetClientRectangle();
|
rcPaint = GetClientRectangle();
|
||||||
paintingAllText = true;
|
paintingAllText = true;
|
||||||
wxClientDC dc(stc);
|
|
||||||
Surface* surfaceWindow = Surface::Allocate();
|
Surface* surfaceWindow = Surface::Allocate();
|
||||||
surfaceWindow->Init(&dc, wMain.GetID());
|
surfaceWindow->Init(dc, wMain.GetID());
|
||||||
|
|
||||||
dc.BeginDrawing();
|
dc->BeginDrawing();
|
||||||
ClipChildren(dc, rcPaint);
|
ClipChildren(*dc, rcPaint);
|
||||||
Paint(surfaceWindow, rcPaint);
|
Paint(surfaceWindow, rcPaint);
|
||||||
dc.EndDrawing();
|
dc->EndDrawing();
|
||||||
|
|
||||||
delete surfaceWindow;
|
delete surfaceWindow;
|
||||||
paintState = notPainting;
|
paintState = notPainting;
|
||||||
|
@@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
void FullPaint();
|
void FullPaint(wxDC *dc);
|
||||||
bool CanPaste();
|
bool CanPaste();
|
||||||
bool GetHideSelection() { return hideSelection; }
|
bool GetHideSelection() { return hideSelection; }
|
||||||
void DoScrollToLine(int line);
|
void DoScrollToLine(int line);
|
||||||
|
Reference in New Issue
Block a user