Branch libreoffice-5-0-4
[LibreOffice.git] / canvas / source / opengl / ogl_canvasbitmap.hxx
blob534837a241273a04b65e5281ed58f2b6c4b4ca9e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_CANVAS_SOURCE_OPENGL_OGL_CANVASBITMAP_HXX
11 #define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_CANVASBITMAP_HXX
13 #include <cppuhelper/compbase2.hxx>
15 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
16 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
18 #include <canvas/base/integerbitmapbase.hxx>
19 #include <canvas/base/basemutexhelper.hxx>
20 #include <basegfx/vector/b2isize.hxx>
22 #include <boost/shared_ptr.hpp>
24 #include "ogl_bitmapcanvashelper.hxx"
25 #include "ogl_spritecanvas.hxx"
28 /* Definition of CanvasBitmap class */
30 namespace oglcanvas
32 typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XBitmapCanvas,
33 ::com::sun::star::rendering::XIntegerBitmap > CanvasBitmapBase_Base;
34 typedef ::canvas::IntegerBitmapBase<
35 canvas::BitmapCanvasBase2<
36 ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >,
37 BitmapCanvasHelper,
38 ::osl::MutexGuard,
39 ::cppu::OWeakObject> > CanvasBitmapBaseT;
41 class CanvasBitmap : public CanvasBitmapBaseT
43 public:
44 /** Create a canvas bitmap for the given surface
46 @param rSize
47 Size of the bitmap
49 @param rDevice
50 Reference device, with which bitmap should be compatible
52 CanvasBitmap( const ::com::sun::star::geometry::IntegerSize2D& rSize,
53 const SpriteCanvasRef& rDevice,
54 SpriteDeviceHelper& rDeviceHelper,
55 bool bHasAlpha );
57 /** Create verbatim copy (including all recorded actions)
59 CanvasBitmap( const CanvasBitmap& rSrc );
61 /// Dispose all internal references
62 virtual void disposeThis() SAL_OVERRIDE;
64 /** Write out recorded actions
66 bool renderRecordedActions() const;
68 private:
69 /** MUST hold here, too, since CanvasHelper only contains a
70 raw pointer (without refcounting)
72 SpriteCanvasRef mpDevice;
73 bool mbHasAlpha;
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */