LibreOffice Module canvas (master) 1
ogl_canvasbitmap.cxx
Go to the documentation of this file.
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 <sal/config.h>
11
12#include <tools/diagnose_ex.h>
13
14#include <utility>
15
16#include "ogl_canvasbitmap.hxx"
17
18
19using namespace ::com::sun::star;
20
21namespace oglcanvas
22{
23 CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize,
24 SpriteCanvasRef rDevice,
25 SpriteDeviceHelper& rDeviceHelper ) :
26 mpDevice(std::move( rDevice ))
27 {
29 "CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
30
31 maCanvasHelper.init( *mpDevice, rDeviceHelper, rSize );
32 }
33
34 CanvasBitmap::CanvasBitmap( const CanvasBitmap& rSrc ) :
35 mpDevice( rSrc.mpDevice )
36 {
37 maCanvasHelper = rSrc.maCanvasHelper;
38 }
39
41 {
42 mpDevice.clear();
43
44 // forward to parent
45 CanvasBitmapBaseT::disposeThis();
46 }
47
49 {
50 return maCanvasHelper.renderRecordedActions();
51 }
52}
53
54/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CanvasBitmap(const css::geometry::IntegerSize2D &rSize, SpriteCanvasRef rDevice, SpriteDeviceHelper &rDeviceHelper)
Create a canvas bitmap for the given surface.
virtual void disposeThis() override
Dispose all internal references.
SpriteCanvasRef mpDevice
MUST hold here, too, since CanvasHelper only contains a raw pointer (without refcounting)
bool renderRecordedActions() const
Write out recorded actions.
#define ENSURE_OR_THROW(c, m)
sal::systools::COMReference< IDirect3DDevice9 > mpDevice
Definition: dx_9rm.cxx:169
::rtl::Reference< SpriteCanvas > SpriteCanvasRef