Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fe2951da
Commit
fe2951da
authored
Nov 03, 2005
by
Phil Krylov
Committed by
Alexandre Julliard
Nov 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache background color brush instead of recreating it at each screen
update.
parent
2d62ba55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
editor.c
dlls/riched20/editor.c
+12
-5
editstr.h
dlls/riched20/editstr.h
+1
-0
paint.c
dlls/riched20/paint.c
+1
-4
No files found.
dlls/riched20/editor.c
View file @
fe2951da
...
...
@@ -821,6 +821,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
nUDArrowX
=
-
1
;
ed
->
nSequence
=
0
;
ed
->
rgbBackColor
=
-
1
;
ed
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
ed
->
bCaretAtEnd
=
FALSE
;
ed
->
nEventMask
=
0
;
ed
->
nModifyStep
=
0
;
...
...
@@ -926,7 +927,8 @@ void ME_DestroyEditor(ME_TextEditor *editor)
if
(
editor
->
pFontCache
[
i
].
hFont
)
DeleteObject
(
editor
->
pFontCache
[
i
].
hFont
);
}
DeleteObject
(
editor
->
hbrBackground
);
FREE_OBJ
(
editor
);
}
...
...
@@ -1265,10 +1267,18 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case
EM_SETBKGNDCOLOR
:
{
LRESULT
lColor
=
ME_GetBackColor
(
editor
);
if
(
editor
->
rgbBackColor
!=
-
1
)
DeleteObject
(
editor
->
hbrBackground
);
if
(
wParam
)
{
editor
->
rgbBackColor
=
-
1
;
editor
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
}
else
{
editor
->
rgbBackColor
=
lParam
;
editor
->
hbrBackground
=
CreateSolidBrush
(
editor
->
rgbBackColor
);
}
if
(
editor
->
bRedraw
)
{
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
...
...
@@ -1792,12 +1802,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
HDC
hDC
=
(
HDC
)
wParam
;
RECT
rc
;
COLORREF
rgbBG
=
ME_GetBackColor
(
editor
);
if
(
GetUpdateRect
(
hWnd
,
&
rc
,
TRUE
))
{
HBRUSH
hbr
=
CreateSolidBrush
(
rgbBG
);
FillRect
(
hDC
,
&
rc
,
hbr
);
DeleteObject
(
hbr
);
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
}
}
return
1
;
...
...
dlls/riched20/editstr.h
View file @
fe2951da
...
...
@@ -270,6 +270,7 @@ typedef struct tagME_TextEditor
int
nSequence
;
int
nOldSelFrom
,
nOldSelTo
;
COLORREF
rgbBackColor
;
HBRUSH
hbrBackground
;
BOOL
bCaretAtEnd
;
int
nEventMask
;
int
nModifyStep
;
...
...
dlls/riched20/paint.c
View file @
fe2951da
...
...
@@ -78,14 +78,11 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda
}
if
(
ye
>
ys
)
{
HBRUSH
hbr
;
hbr
=
CreateSolidBrush
(
ME_GetBackColor
(
c
.
editor
));
rc
.
left
=
xs
;
rc
.
top
=
ys
;
rc
.
right
=
xe
;
rc
.
bottom
=
ye
;
FillRect
(
hDC
,
&
rc
,
hbr
);
DeleteObject
(
hbr
);
FillRect
(
hDC
,
&
rc
,
c
.
editor
->
hbrBackground
);
}
if
(
ys
==
c
.
pt
.
y
)
/* don't overwrite the top bar */
ys
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment