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
2c71b853
Commit
2c71b853
authored
Jul 24, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass the context to get_drawable_size().
parent
fb77678e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
31 deletions
+34
-31
device.c
dlls/wined3d/device.c
+21
-19
state.c
dlls/wined3d/state.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+6
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-5
No files found.
dlls/wined3d/device.c
View file @
2c71b853
...
...
@@ -4888,6 +4888,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
UINT
drawable_width
,
drawable_height
;
IWineD3DSurfaceImpl
*
depth_stencil
=
(
IWineD3DSurfaceImpl
*
)
This
->
stencilBufferTarget
;
IWineD3DSwapChainImpl
*
swapchain
=
NULL
;
struct
WineD3DContext
*
context
;
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
...
...
@@ -4923,9 +4924,9 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
}
}
ActivateContext
(
This
,
(
IWineD3DSurface
*
)
target
,
CTXUSAGE_CLEAR
);
context
=
ActivateContext
(
This
,
(
IWineD3DSurface
*
)
target
,
CTXUSAGE_CLEAR
);
target
->
get_drawable_size
(
targe
t
,
&
drawable_width
,
&
drawable_height
);
target
->
get_drawable_size
(
contex
t
,
&
drawable_width
,
&
drawable_height
);
ENTER_GL
();
...
...
@@ -7695,28 +7696,29 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
}
}
void
get_drawable_size_pbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
dev
=
This
->
resource
.
wineD3DDevice
;
/* The drawable size of a pbuffer render target is the current pbuffer size
*/
*
width
=
dev
->
pbufferWidth
;
*
height
=
dev
->
pbufferHeight
;
void
get_drawable_size_pbuffer
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
current_rt
)
->
resource
.
wineD3DDevice
;
/* The drawable size of a pbuffer render target is the current pbuffer size.
*/
*
width
=
dev
ice
->
pbufferWidth
;
*
height
=
dev
ice
->
pbufferHeight
;
}
void
get_drawable_size_fbo
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size
*/
*
width
=
This
->
pow2Width
;
*
height
=
This
->
pow2Height
;
void
get_drawable_size_fbo
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
context
->
current_rt
;
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */
*
width
=
surface
->
pow2Width
;
*
height
=
surface
->
pow2Height
;
}
void
get_drawable_size_backbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DDeviceImpl
*
dev
=
This
->
resource
.
wineD3DDevice
;
void
get_drawable_size_backbuffer
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
context
->
surface
;
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
* current context's drawable, which is the size of the back buffer of the swapchain
* the active context belongs to. The back buffer of the swapchain is stored as the
* surface the context belongs to.
*/
*
width
=
((
IWineD3DSurfaceImpl
*
)
dev
->
activeContext
->
surface
)
->
currentDesc
.
Width
;
*
height
=
((
IWineD3DSurfaceImpl
*
)
dev
->
activeContext
->
surface
)
->
currentDesc
.
Height
;
* surface the context belongs to. */
*
width
=
surface
->
currentDesc
.
Width
;
*
height
=
surface
->
currentDesc
.
Height
;
}
dlls/wined3d/state.c
View file @
2c71b853
...
...
@@ -4532,7 +4532,7 @@ static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, W
stateblock
->
viewport
.
Width
,
stateblock
->
viewport
.
Height
);
}
else
{
target
=
(
IWineD3DSurfaceImpl
*
)
stateblock
->
wineD3DDevice
->
render_targets
[
0
];
target
->
get_drawable_size
(
targe
t
,
&
width
,
&
height
);
target
->
get_drawable_size
(
contex
t
,
&
width
,
&
height
);
glViewport
(
stateblock
->
viewport
.
X
,
(
height
-
(
stateblock
->
viewport
.
Y
+
stateblock
->
viewport
.
Height
)),
...
...
@@ -4674,7 +4674,7 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
UINT
width
;
IWineD3DSurfaceImpl
*
target
=
(
IWineD3DSurfaceImpl
*
)
stateblock
->
wineD3DDevice
->
render_targets
[
0
];
target
->
get_drawable_size
(
targe
t
,
&
width
,
&
height
);
target
->
get_drawable_size
(
contex
t
,
&
width
,
&
height
);
/* Warning: glScissor uses window coordinates, not viewport coordinates, so our viewport correction does not apply
* Warning2: Even in windowed mode the coords are relative to the window, not the screen
*/
...
...
dlls/wined3d/swapchain.c
View file @
2c71b853
...
...
@@ -402,10 +402,11 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *
return
ctx
;
}
void
get_drawable_size_swapchain
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
)
{
void
get_drawable_size_swapchain
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
)
{
IWineD3DSurfaceImpl
*
surface
=
(
IWineD3DSurfaceImpl
*
)
context
->
surface
;
/* The drawable size of an onscreen drawable is the surface size.
* (Actually: The window size, but the surface is created in window size)
*/
*
width
=
This
->
currentDesc
.
Width
;
*
height
=
This
->
currentDesc
.
Height
;
* (Actually: The window size, but the surface is created in window size) */
*
width
=
surface
->
currentDesc
.
Width
;
*
height
=
surface
->
currentDesc
.
Height
;
}
dlls/wined3d/wined3d_private.h
View file @
2c71b853
...
...
@@ -1957,7 +1957,7 @@ struct IWineD3DSurfaceImpl
UINT
pow2Height
;
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
void
(
*
get_drawable_size
)(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
(
*
get_drawable_size
)(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
);
/* Oversized texture */
RECT
glRect
;
...
...
@@ -2051,10 +2051,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DL
void
WINAPI
IWineD3DBaseSurfaceImpl_BindTexture
(
IWineD3DSurface
*
iface
,
BOOL
srgb
);
const
void
*
WINAPI
IWineD3DBaseSurfaceImpl_GetData
(
IWineD3DSurface
*
iface
);
void
get_drawable_size_swapchain
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_backbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_pbuffer
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_fbo
(
IWineD3DSurfaceImpl
*
This
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_swapchain
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_backbuffer
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_pbuffer
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
);
void
get_drawable_size_fbo
(
struct
WineD3DContext
*
context
,
UINT
*
width
,
UINT
*
height
);
void
flip_surface
(
IWineD3DSurfaceImpl
*
front
,
IWineD3DSurfaceImpl
*
back
);
...
...
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