Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
98ed6370
Commit
98ed6370
authored
Mar 16, 2004
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2/win32/win32_graphics.cpp: fixed a bunch of memory leaks and
fixed a bug in drawRect()
parent
119858b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
modules/gui/skins2/win32/win32_graphics.cpp
modules/gui/skins2/win32/win32_graphics.cpp
+15
-7
No files found.
modules/gui/skins2/win32/win32_graphics.cpp
View file @
98ed6370
...
...
@@ -2,7 +2,7 @@
* win32_graphics.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: win32_graphics.cpp,v 1.4 2004/01/28 15:51:16 gbazin Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -241,6 +241,7 @@ void Win32Graphics::fillRect( int left, int top, int width, int height,
HRGN
newMask
=
CreateRectRgn
(
left
,
top
,
left
+
width
,
top
+
height
);
CombineRgn
(
m_mask
,
m_mask
,
newMask
,
RGN_OR
);
SelectClipRgn
(
m_hDC
,
m_mask
);
DeleteObject
(
newMask
);
// Create a brush with the color
int
red
=
(
color
&
0xff0000
)
>>
16
;
...
...
@@ -255,6 +256,7 @@ void Win32Graphics::fillRect( int left, int top, int width, int height,
r
.
right
=
left
+
width
;
r
.
bottom
=
top
+
height
;
FillRect
(
m_hDC
,
&
r
,
hBrush
);
DeleteObject
(
hBrush
);
}
...
...
@@ -262,14 +264,21 @@ void Win32Graphics::drawRect( int left, int top, int width, int height,
uint32_t
color
)
{
// Update the mask with the rectangle
HRGN
l1
=
CreateRectRgn
(
left
,
top
,
left
+
width
,
top
);
HRGN
l2
=
CreateRectRgn
(
left
+
width
,
top
,
left
+
width
,
top
+
height
);
HRGN
l3
=
CreateRectRgn
(
left
+
width
,
top
+
height
,
left
,
top
+
height
);
HRGN
l4
=
CreateRectRgn
(
left
,
top
+
height
,
left
,
top
);
HRGN
l1
=
CreateRectRgn
(
left
,
top
,
left
+
width
,
top
+
1
);
HRGN
l2
=
CreateRectRgn
(
left
+
width
-
1
,
top
,
left
+
width
,
top
+
height
);
HRGN
l3
=
CreateRectRgn
(
left
,
top
+
height
-
1
,
left
+
width
,
top
+
height
);
HRGN
l4
=
CreateRectRgn
(
left
,
top
,
left
+
1
,
top
+
height
);
CombineRgn
(
m_mask
,
m_mask
,
l1
,
RGN_OR
);
CombineRgn
(
m_mask
,
m_mask
,
l2
,
RGN_OR
);
CombineRgn
(
m_mask
,
m_mask
,
l3
,
RGN_OR
);
CombineRgn
(
m_mask
,
m_mask
,
l4
,
RGN_OR
);
DeleteObject
(
l1
);
DeleteObject
(
l2
);
DeleteObject
(
l3
);
DeleteObject
(
l4
);
SelectClipRgn
(
m_hDC
,
m_mask
);
// Create a pen with the color
...
...
@@ -329,8 +338,7 @@ bool Win32Graphics::hit( int x, int y ) const
void
Win32Graphics
::
addSegmentInRegion
(
HRGN
&
rMask
,
int
start
,
int
end
,
int
line
)
{
HRGN
buffer
;
buffer
=
CreateRectRgn
(
start
,
line
,
end
,
line
+
1
);
HRGN
buffer
=
CreateRectRgn
(
start
,
line
,
end
,
line
+
1
);
CombineRgn
(
rMask
,
buffer
,
rMask
,
RGN_OR
);
DeleteObject
(
buffer
);
}
...
...
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