Kaydet (Commit) 704e5abb authored tarafından Chris Sherlock's avatar Chris Sherlock

Move bitmap functions in header, warn if calling GetBitmap() in Printer

Change-Id: Id2325822730d3d9167706c8c4118eaa3ca727195
üst 1893ca5f
......@@ -544,19 +544,13 @@ public:
SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
///@}
/** @name Bitmap functions
*/
///@{
SAL_DLLPRIVATE void ImplDrawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry );
SAL_DLLPRIVATE void DrawAlphaBitmap ( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
virtual void ClipToPaintRegion ( Rectangle& rDstRect );
SAL_DLLPRIVATE void ImplPrintTransparent ( const Bitmap& rBmp, const Bitmap& rMask,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
SAL_DLLPRIVATE Color ImplDrawModeToColor ( const Color& rColor ) const;
///@}
/** @name Frame functions
*/
......@@ -861,6 +855,13 @@ public:
const Image& rImage,
sal_uInt16 nStyle = 0 );
virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
/** Query extended bitmap (with alpha channel, if available).
*/
BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
/** Retrieve downsampled and cropped bitmap
@attention This method ignores negative rDstSz values, thus
......@@ -926,6 +927,15 @@ protected:
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
BitmapEx& rBitmapEx );
private:
SAL_DLLPRIVATE void DrawAlphaBitmap(
const Bitmap& rBmp,
const AlphaMask& rAlpha,
const Point& rDestPt,
const Size& rDestSize,
const Point& rSrcPtPixel,
const Size& rSrcSizePixel );
SAL_DLLPRIVATE Bitmap BlendBitmap(
Bitmap aBmp,
BitmapReadAccess* pP,
......@@ -1503,12 +1513,6 @@ public:
Color GetPixel( const Point& rPt ) const;
Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
/** Query extended bitmap (with alpha channel, if available).
*/
BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
// Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
virtual void EnableRTL( bool bEnable = true);
bool IsRTLEnabled() const { return mbEnableRTL; }
......
......@@ -51,9 +51,6 @@ namespace vcl {
}
// - Printer-Types -
#define PAGEQUEUE_ALLPAGES 0xFFFF
enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
......@@ -62,9 +59,6 @@ enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
SUPPORT_SETUPDIALOG, SUPPORT_FAX, SUPPORT_PDF };
// - PrinterPage -
class VCL_DLLPUBLIC PrinterPage
{
GDIMetaFile* mpMtf;
......@@ -85,9 +79,6 @@ public:
// - QueueInfo -
class VCL_DLLPUBLIC QueueInfo
{
friend class Printer;
......@@ -119,9 +110,6 @@ public:
};
// - PrinterOptions -
enum PrinterTransparencyMode
{
PRINTER_TRANSPARENCY_AUTO = 0,
......@@ -208,9 +196,6 @@ public:
};
// - Printer -
class VCL_DLLPUBLIC Printer : public OutputDevice
{
friend class OutputDevice;
......@@ -278,6 +263,7 @@ protected:
public:
void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient );
virtual Bitmap GetBitmap( const Point& rSrcPt, const Size& rSize ) const SAL_OVERRIDE;
protected:
......
......@@ -1844,4 +1844,12 @@ void Printer::DrawImage( const Point&, const Size&, const Image&, sal_uInt16 )
assert(false);
}
Bitmap Printer::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
{
SAL_WARN("vcl.gdi", "GetBitmap(): This should never be called on by a Printer instance");
return OutputDevice::GetBitmap( rSrcPt, rSize );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -474,7 +474,7 @@ bool OutputDevice::TransformAndReduceBitmapExToTargetRange(
aVisibleRange.transform(aMakeVisibleRangeRelative);
}
// for pixel devices, do *not* limit size, else OutputDevice::ImplDrawAlpha
// for pixel devices, do *not* limit size, else OutputDevice::DrawAlphaBitmap
// will create another, badly scaled bitmap to do the job. Nonetheless, do a
// maximum clipping of something big (1600x1280x2). Add 1.0 to avoid rounding
// errors in rough estimations
......@@ -880,8 +880,6 @@ void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
{
OSL_ENSURE(OUTDEV_PRINTER != GetOutDevType(), "OutputDevice::GetBitmap with sorce type OUTDEV_PRINTER should not be used (!)");
Bitmap aBmp;
long nX = ImplLogicXToDevicePixel( rSrcPt.X() );
long nY = ImplLogicYToDevicePixel( rSrcPt.Y() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment