~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/dxgi/surface.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright 2009 Henri Verbeet for CodeWeavers
  3  *
  4  * This library is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2.1 of the License, or (at your option) any later version.
  8  *
  9  * This library is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with this library; if not, write to the Free Software
 16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 17  *
 18  */
 19 
 20 #include "config.h"
 21 #include "wine/port.h"
 22 
 23 #include "dxgi_private.h"
 24 
 25 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
 26 
 27 /* Inner IUnknown methods */
 28 
 29 static inline struct dxgi_surface *dxgi_surface_from_inner_unknown(IUnknown *iface)
 30 {
 31     return (struct dxgi_surface *)((char*)iface - FIELD_OFFSET(struct dxgi_surface, inner_unknown_vtbl));
 32 }
 33 
 34 static HRESULT STDMETHODCALLTYPE dxgi_surface_inner_QueryInterface(IUnknown *iface, REFIID riid, void **object)
 35 {
 36     struct dxgi_surface *This = dxgi_surface_from_inner_unknown(iface);
 37 
 38     TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
 39 
 40     if (IsEqualGUID(riid, &IID_IDXGISurface)
 41             || IsEqualGUID(riid, &IID_IDXGIDeviceSubObject)
 42             || IsEqualGUID(riid, &IID_IDXGIObject)
 43             || IsEqualGUID(riid, &IID_IUnknown))
 44     {
 45         IUnknown_AddRef((IUnknown *)This);
 46         *object = This;
 47         return S_OK;
 48     }
 49 
 50     WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
 51 
 52     *object = NULL;
 53     return E_NOINTERFACE;
 54 }
 55 
 56 static ULONG STDMETHODCALLTYPE dxgi_surface_inner_AddRef(IUnknown *iface)
 57 {
 58     struct dxgi_surface *This = dxgi_surface_from_inner_unknown(iface);
 59     ULONG refcount = InterlockedIncrement(&This->refcount);
 60 
 61     TRACE("%p increasing refcount to %u\n", This, refcount);
 62 
 63     return refcount;
 64 }
 65 
 66 static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
 67 {
 68     struct dxgi_surface *This = dxgi_surface_from_inner_unknown(iface);
 69     ULONG refcount = InterlockedDecrement(&This->refcount);
 70 
 71     TRACE("%p decreasing refcount to %u\n", This, refcount);
 72 
 73     if (!refcount)
 74     {
 75         IDXGIDevice_Release(This->device);
 76         HeapFree(GetProcessHeap(), 0, This);
 77     }
 78 
 79     return refcount;
 80 }
 81 
 82 /* IUnknown methods */
 83 
 84 static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface *iface, REFIID riid, void **object)
 85 {
 86     struct dxgi_surface *This = (struct dxgi_surface *)iface;
 87     TRACE("Forwarding to outer IUnknown\n");
 88     return IUnknown_QueryInterface(This->outer_unknown, riid, object);
 89 }
 90 
 91 static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface *iface)
 92 {
 93     struct dxgi_surface *This = (struct dxgi_surface *)iface;
 94     TRACE("Forwarding to outer IUnknown\n");
 95     return IUnknown_AddRef(This->outer_unknown);
 96 }
 97 
 98 static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface)
 99 {
100     struct dxgi_surface *This = (struct dxgi_surface *)iface;
101     TRACE("Forwarding to outer IUnknown\n");
102     return IUnknown_Release(This->outer_unknown);
103 }
104 
105 /* IDXGIObject methods */
106 
107 static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface,
108         REFGUID guid, UINT data_size, const void *data)
109 {
110     FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
111 
112     return E_NOTIMPL;
113 }
114 
115 static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface,
116         REFGUID guid, const IUnknown *object)
117 {
118     FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
119 
120     return E_NOTIMPL;
121 }
122 
123 static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface,
124         REFGUID guid, UINT *data_size, void *data)
125 {
126     FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
127 
128     return E_NOTIMPL;
129 }
130 
131 static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent)
132 {
133     struct dxgi_surface *This = (struct dxgi_surface *)iface;
134 
135     TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
136 
137     return IDXGIDevice_QueryInterface(This->device, riid, parent);
138 }
139 
140 /* IDXGIDeviceSubObject methods */
141 
142 static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface *iface, REFIID riid, void **device)
143 {
144     struct dxgi_surface *This = (struct dxgi_surface *)iface;
145 
146     TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
147 
148     return IDXGIDevice_QueryInterface(This->device, riid, device);
149 }
150 
151 /* IDXGISurface methods */
152 static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_SURFACE_DESC *desc)
153 {
154     FIXME("iface %p, desc %p stub!\n", iface, desc);
155 
156     return E_NOTIMPL;
157 }
158 
159 static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags)
160 {
161     FIXME("iface %p, mapped_rect %p, flags %#x stub!\n", iface, mapped_rect, flags);
162 
163     return E_NOTIMPL;
164 }
165 
166 static HRESULT STDMETHODCALLTYPE dxgi_surface_Unmap(IDXGISurface *iface)
167 {
168     FIXME("iface %p stub!\n", iface);
169 
170     return E_NOTIMPL;
171 }
172 
173 static const struct IDXGISurfaceVtbl dxgi_surface_vtbl =
174 {
175     /* IUnknown methods */
176     dxgi_surface_QueryInterface,
177     dxgi_surface_AddRef,
178     dxgi_surface_Release,
179     /* IDXGIObject methods */
180     dxgi_surface_SetPrivateData,
181     dxgi_surface_SetPrivateDataInterface,
182     dxgi_surface_GetPrivateData,
183     dxgi_surface_GetParent,
184     /* IDXGIDeviceSubObject methods */
185     dxgi_surface_GetDevice,
186     /* IDXGISurface methods */
187     dxgi_surface_GetDesc,
188     dxgi_surface_Map,
189     dxgi_surface_Unmap,
190 };
191 
192 static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl =
193 {
194     /* IUnknown methods */
195     dxgi_surface_inner_QueryInterface,
196     dxgi_surface_inner_AddRef,
197     dxgi_surface_inner_Release,
198 };
199 
200 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer)
201 {
202     surface->vtbl = &dxgi_surface_vtbl;
203     surface->inner_unknown_vtbl = &dxgi_surface_inner_unknown_vtbl;
204     surface->refcount = 1;
205     surface->outer_unknown = outer ? outer : (IUnknown *)&surface->inner_unknown_vtbl;
206     surface->device = device;
207     IDXGIDevice_AddRef(device);
208 
209     return S_OK;
210 }
211 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.