Branch libreoffice-5-0-4
[LibreOffice.git] / canvas / source / opengl / ogl_canvasbitmap.cxx
blobb7c5d9bd3e01e2364a8e2e88c1143a397d33ad3c
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 #include "ogl_canvasbitmap.hxx"
12 #include <canvas/debug.hxx>
13 #include <canvas/canvastools.hxx>
14 #include <tools/diagnose_ex.h>
17 using namespace ::com::sun::star;
19 namespace oglcanvas
21 CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize,
22 const SpriteCanvasRef& rDevice,
23 SpriteDeviceHelper& rDeviceHelper,
24 bool bHasAlpha ) :
25 mpDevice( rDevice ),
26 mbHasAlpha( bHasAlpha )
28 ENSURE_OR_THROW( mpDevice.is(),
29 "CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
31 maCanvasHelper.init( *mpDevice.get(), rDeviceHelper, rSize );
34 CanvasBitmap::CanvasBitmap( const CanvasBitmap& rSrc ) :
35 mpDevice( rSrc.mpDevice ),
36 mbHasAlpha( rSrc.mbHasAlpha )
38 maCanvasHelper = rSrc.maCanvasHelper;
41 void CanvasBitmap::disposeThis()
43 mpDevice.clear();
45 // forward to parent
46 CanvasBitmapBaseT::disposeThis();
49 bool CanvasBitmap::renderRecordedActions() const
51 return maCanvasHelper.renderRecordedActions();
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */