mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 17:16:12 +00:00
41 lines
738 B
C++
41 lines
738 B
C++
|
|
#include "gfxRect.h"
|
|
#include "mozilla/gfx/Rect.h"
|
|
|
|
namespace mozilla {
|
|
namespace gfx {
|
|
class DrawTarget;
|
|
class SourceSurface;
|
|
class ScaledFont;
|
|
}
|
|
}
|
|
|
|
namespace mozilla {
|
|
namespace gfx {
|
|
|
|
inline Rect ToRect(const gfxRect &aRect)
|
|
{
|
|
return Rect(Float(aRect.x), Float(aRect.y),
|
|
Float(aRect.width), Float(aRect.height));
|
|
}
|
|
|
|
inline gfxRect GFXRect(const Rect &aRect)
|
|
{
|
|
return gfxRect(aRect.x, aRect.y, aRect.width, aRect.height);
|
|
}
|
|
|
|
inline gfxASurface::gfxContentType ContentForFormat(const SurfaceFormat &aFormat)
|
|
{
|
|
switch (aFormat) {
|
|
case FORMAT_B8G8R8X8:
|
|
return gfxASurface::CONTENT_COLOR;
|
|
case FORMAT_A8:
|
|
return gfxASurface::CONTENT_ALPHA;
|
|
default:
|
|
return gfxASurface::CONTENT_COLOR_ALPHA;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|