cid#1607171 Data race condition
[LibreOffice.git] / canvas / source / opengl / ogl_bitmapcanvashelper.hxx
blob5bdb9713d211af1c27bef68214a34bf9807c07c7
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 #pragma once
12 #include <com/sun/star/geometry/IntegerPoint2D.hpp>
13 #include <com/sun/star/geometry/IntegerRectangle2D.hpp>
14 #include <com/sun/star/rendering/IntegerBitmapLayout.hpp>
16 #include "ogl_canvashelper.hxx"
18 namespace oglcanvas
20 /** Helper class for basic canvas functionality. */
21 class BitmapCanvasHelper : public CanvasHelper
23 public:
24 BitmapCanvasHelper();
26 /// Release all references
27 void disposing();
29 /** Initialize canvas helper
31 This method late-initializes the canvas helper, providing
32 it with the necessary device and output objects. Note that
33 the CanvasHelper does <em>not</em> take ownership of the
34 passed rDevice reference, nor does it perform any
35 reference counting. Thus, to prevent the reference counted
36 SpriteCanvas object from deletion, the user of this class
37 is responsible for holding ref-counted references itself!
39 @param rDevice
40 Reference device this canvas is associated with
43 void init( css::rendering::XGraphicDevice& rDevice,
44 SpriteDeviceHelper& rDeviceHelper,
45 const css::geometry::IntegerSize2D& rSize );
47 // BitmapCanvasHelper functionality
48 // ================================
50 const css::geometry::IntegerSize2D& getSize() const { return maSize; }
52 css::uno::Reference< css::rendering::XBitmap >
53 getScaledBitmap( const css::geometry::RealSize2D& newSize,
54 bool beFast );
56 css::uno::Sequence< sal_Int8 >
57 getData( css::rendering::IntegerBitmapLayout& bitmapLayout,
58 const css::geometry::IntegerRectangle2D& rect );
60 css::uno::Sequence< sal_Int8 >
61 getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
62 const css::geometry::IntegerPoint2D& pos );
64 css::rendering::IntegerBitmapLayout getMemoryLayout() const;
66 private:
67 css::geometry::IntegerSize2D maSize;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */