Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
editor.c
dlls/riched20/editor.c
+11
-4
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) {
...
@@ -821,6 +821,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
nUDArrowX
=
-
1
;
ed
->
nUDArrowX
=
-
1
;
ed
->
nSequence
=
0
;
ed
->
nSequence
=
0
;
ed
->
rgbBackColor
=
-
1
;
ed
->
rgbBackColor
=
-
1
;
ed
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
ed
->
bCaretAtEnd
=
FALSE
;
ed
->
bCaretAtEnd
=
FALSE
;
ed
->
nEventMask
=
0
;
ed
->
nEventMask
=
0
;
ed
->
nModifyStep
=
0
;
ed
->
nModifyStep
=
0
;
...
@@ -926,6 +927,7 @@ void ME_DestroyEditor(ME_TextEditor *editor)
...
@@ -926,6 +927,7 @@ void ME_DestroyEditor(ME_TextEditor *editor)
if
(
editor
->
pFontCache
[
i
].
hFont
)
if
(
editor
->
pFontCache
[
i
].
hFont
)
DeleteObject
(
editor
->
pFontCache
[
i
].
hFont
);
DeleteObject
(
editor
->
pFontCache
[
i
].
hFont
);
}
}
DeleteObject
(
editor
->
hbrBackground
);
FREE_OBJ
(
editor
);
FREE_OBJ
(
editor
);
}
}
...
@@ -1265,10 +1267,18 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -1265,10 +1267,18 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case
EM_SETBKGNDCOLOR
:
case
EM_SETBKGNDCOLOR
:
{
{
LRESULT
lColor
=
ME_GetBackColor
(
editor
);
LRESULT
lColor
=
ME_GetBackColor
(
editor
);
if
(
editor
->
rgbBackColor
!=
-
1
)
DeleteObject
(
editor
->
hbrBackground
);
if
(
wParam
)
if
(
wParam
)
{
editor
->
rgbBackColor
=
-
1
;
editor
->
rgbBackColor
=
-
1
;
editor
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
}
else
else
{
editor
->
rgbBackColor
=
lParam
;
editor
->
rgbBackColor
=
lParam
;
editor
->
hbrBackground
=
CreateSolidBrush
(
editor
->
rgbBackColor
);
}
if
(
editor
->
bRedraw
)
if
(
editor
->
bRedraw
)
{
{
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
...
@@ -1792,12 +1802,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
...
@@ -1792,12 +1802,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
{
HDC
hDC
=
(
HDC
)
wParam
;
HDC
hDC
=
(
HDC
)
wParam
;
RECT
rc
;
RECT
rc
;
COLORREF
rgbBG
=
ME_GetBackColor
(
editor
);
if
(
GetUpdateRect
(
hWnd
,
&
rc
,
TRUE
))
if
(
GetUpdateRect
(
hWnd
,
&
rc
,
TRUE
))
{
{
HBRUSH
hbr
=
CreateSolidBrush
(
rgbBG
);
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
FillRect
(
hDC
,
&
rc
,
hbr
);
DeleteObject
(
hbr
);
}
}
}
}
return
1
;
return
1
;
...
...
dlls/riched20/editstr.h
View file @
fe2951da
...
@@ -270,6 +270,7 @@ typedef struct tagME_TextEditor
...
@@ -270,6 +270,7 @@ typedef struct tagME_TextEditor
int
nSequence
;
int
nSequence
;
int
nOldSelFrom
,
nOldSelTo
;
int
nOldSelFrom
,
nOldSelTo
;
COLORREF
rgbBackColor
;
COLORREF
rgbBackColor
;
HBRUSH
hbrBackground
;
BOOL
bCaretAtEnd
;
BOOL
bCaretAtEnd
;
int
nEventMask
;
int
nEventMask
;
int
nModifyStep
;
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
...
@@ -78,14 +78,11 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda
}
}
if
(
ye
>
ys
)
{
if
(
ye
>
ys
)
{
HBRUSH
hbr
;
hbr
=
CreateSolidBrush
(
ME_GetBackColor
(
c
.
editor
));
rc
.
left
=
xs
;
rc
.
left
=
xs
;
rc
.
top
=
ys
;
rc
.
top
=
ys
;
rc
.
right
=
xe
;
rc
.
right
=
xe
;
rc
.
bottom
=
ye
;
rc
.
bottom
=
ye
;
FillRect
(
hDC
,
&
rc
,
hbr
);
FillRect
(
hDC
,
&
rc
,
c
.
editor
->
hbrBackground
);
DeleteObject
(
hbr
);
}
}
if
(
ys
==
c
.
pt
.
y
)
/* don't overwrite the top bar */
if
(
ys
==
c
.
pt
.
y
)
/* don't overwrite the top bar */
ys
++
;
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