static void STDMETHODCALLTYPE d2d_bitmap_GetFactory(ID2D1Bitmap *iface, ID2D1Factory **factory) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); TRACE("iface %p, factory %p.\n", iface, factory); ID2D1Factory_AddRef(*factory = bitmap->factory); }
static ULONG STDMETHODCALLTYPE d2d_bitmap_AddRef(ID2D1Bitmap *iface) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); ULONG refcount = InterlockedIncrement(&bitmap->refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); return refcount; }
static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_bitmap_GetPixelSize(ID2D1Bitmap *iface, D2D1_SIZE_U *pixel_size) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); TRACE("iface %p, pixel_size %p.\n", iface, pixel_size); *pixel_size = bitmap->pixel_size; return pixel_size; }
static void STDMETHODCALLTYPE d2d_bitmap_GetDpi(ID2D1Bitmap *iface, float *dpi_x, float *dpi_y) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y); *dpi_x = bitmap->dpi_x; *dpi_y = bitmap->dpi_y; }
static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_bitmap_GetPixelFormat(ID2D1Bitmap *iface, D2D1_PIXEL_FORMAT *format) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); TRACE("iface %p, format %p.\n", iface, format); *format = bitmap->format; return format; }
static D2D1_SIZE_F * STDMETHODCALLTYPE d2d_bitmap_GetSize(ID2D1Bitmap *iface, D2D1_SIZE_F *size) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); TRACE("iface %p, size %p.\n", iface, size); size->width = bitmap->pixel_size.width / (bitmap->dpi_x / 96.0f); size->height = bitmap->pixel_size.height / (bitmap->dpi_y / 96.0f); return size; }
static ULONG STDMETHODCALLTYPE d2d_bitmap_Release(ID2D1Bitmap *iface) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); ULONG refcount = InterlockedDecrement(&bitmap->refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (!refcount) HeapFree(GetProcessHeap(), 0, bitmap); return refcount; }
static ULONG STDMETHODCALLTYPE d2d_bitmap_Release(ID2D1Bitmap *iface) { struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); ULONG refcount = InterlockedDecrement(&bitmap->refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) { ID3D10ShaderResourceView_Release(bitmap->view); ID2D1Factory_Release(bitmap->factory); HeapFree(GetProcessHeap(), 0, bitmap); } return refcount; }