Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #include "ogl_canvasbitmap.hxx"
11 :
12 : #include <canvas/debug.hxx>
13 : #include <canvas/canvastools.hxx>
14 : #include <tools/diagnose_ex.h>
15 :
16 :
17 : using namespace ::com::sun::star;
18 :
19 : namespace oglcanvas
20 : {
21 0 : CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize,
22 : const SpriteCanvasRef& rDevice,
23 : SpriteDeviceHelper& rDeviceHelper,
24 : bool bHasAlpha ) :
25 : mpDevice( rDevice ),
26 0 : mbHasAlpha( bHasAlpha )
27 : {
28 0 : ENSURE_OR_THROW( mpDevice.is(),
29 : "CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
30 :
31 0 : maCanvasHelper.init( *mpDevice.get(), rDeviceHelper, rSize );
32 0 : }
33 :
34 0 : CanvasBitmap::CanvasBitmap( const CanvasBitmap& rSrc ) :
35 : mpDevice( rSrc.mpDevice ),
36 0 : mbHasAlpha( rSrc.mbHasAlpha )
37 : {
38 0 : maCanvasHelper = rSrc.maCanvasHelper;
39 0 : }
40 :
41 0 : void SAL_CALL CanvasBitmap::disposeThis()
42 : {
43 0 : mpDevice.clear();
44 :
45 : // forward to parent
46 0 : CanvasBitmapBaseT::disposeThis();
47 0 : }
48 :
49 0 : bool CanvasBitmap::renderRecordedActions() const
50 : {
51 0 : return maCanvasHelper.renderRecordedActions();
52 : }
53 0 : }
54 :
55 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|