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