1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 * nsWindowGfx - Painting and aceleration.
14 #include <imgIContainer.h>
16 class nsISVGPaintContext
;
20 enum IconSizeType
{ kSmallIcon
, kRegularIcon
};
21 static mozilla::LayoutDeviceIntSize
GetIconMetrics(IconSizeType aSizeType
);
24 * Renders an imgIContainer to a HICON.
25 * aContainer - the image to render.
26 * aSVGContext - Optional CSS context properties to apply. Ignored if the
27 * container is not an SVG image.
28 * aIsCursor - true if this icon will be used as a mouse cursor.
29 * aHotSpot - the position of the hot spot for a mouse cursor.
30 * aScaledSize - the size of the icon to generate.
31 * aIcon - Out parameter for the returned HICON. Required.
33 static nsresult
CreateIcon(imgIContainer
* aContainer
,
34 nsISVGPaintContext
* aSVGContext
, bool aIsCursor
,
35 mozilla::LayoutDeviceIntPoint aHotspot
,
36 mozilla::LayoutDeviceIntSize aScaledSize
,
43 static uint8_t* Data32BitTo1Bit(uint8_t* aImageData
, uint32_t aWidth
,
45 static HBITMAP
DataToBitmap(uint8_t* aImageData
, uint32_t aWidth
,
46 uint32_t aHeight
, uint32_t aDepth
);
49 #endif // WindowGfx_h__