LibreOffice Module canvas (master)  1
dx_spritedevicehelper.hxx
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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_SPRITEDEVICEHELPER_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_SPRITEDEVICEHELPER_HXX
22 
23 #include <com/sun/star/awt/Rectangle.hpp>
24 #include <com/sun/star/rendering/XGraphicDevice.hpp>
25 #include <com/sun/star/rendering/XBufferController.hpp>
26 
27 #include "dx_rendermodule.hxx"
28 #include "dx_surfacebitmap.hxx"
29 #include "dx_devicehelper.hxx"
30 
32 
33 
34 namespace dxcanvas
35 {
36  class SpriteCanvas;
37 
39  {
40  public:
42 
43  void init( vcl::Window& rWindow,
44  SpriteCanvas& rSpriteCanvas,
45  const css::awt::Rectangle& rRect,
46  bool bFullscreen );
47 
49  void disposing();
50 
51  // partial override XWindowGraphicDevice
52  css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(
53  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
54  const css::geometry::IntegerSize2D& size );
55  css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(
56  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
57  const css::geometry::IntegerSize2D& size );
58  css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(
59  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
60  const css::geometry::IntegerSize2D& size );
61  css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
62  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
63  const css::geometry::IntegerSize2D& size );
64 
65  void destroyBuffers( );
66  bool showBuffer( bool bIsVisible, bool bUpdateAll );
67  bool switchBuffer( bool bIsVisible, bool bUpdateAll );
68 
71  const std::shared_ptr<canvas::ISurfaceProxyManager> &getSurfaceProxy() const { return mpSurfaceProxyManager; }
72 
73  css::uno::Any isAccelerated() const;
74 
75  void notifySizeUpdate( const css::awt::Rectangle& rBounds );
76 
80  void dumpScreenContent() const;
81 
82  private:
83  void resizeBackBuffer( const ::basegfx::B2ISize& rNewSize );
84  HWND getHwnd() const;
85 
88 
90 
92  std::shared_ptr<canvas::ISurfaceProxyManager> mpSurfaceProxyManager;
93 
96  };
97 }
98 
99 #endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_SPRITEDEVICEHELPER_HXX
100 
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< canvas::ISurfaceProxyManager > mpSurfaceProxyManager
Instance passing out HW textures.
void init(vcl::Window &rWindow, SpriteCanvas &rSpriteCanvas, const css::awt::Rectangle &rRect, bool bFullscreen)
css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr
bool switchBuffer(bool bIsVisible, bool bUpdateAll)
IDXRenderModuleSharedPtr mpRenderModule
Our encapsulation interface to DirectX.
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
const IDXRenderModuleSharedPtr & getRenderModule() const
const DXSurfaceBitmapSharedPtr & getBackBuffer() const
bool showBuffer(bool bIsVisible, bool bUpdateAll)
size
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
void dumpScreenContent() const
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of curren...
DXSurfaceBitmapSharedPtr mpBackBuffer
void resizeBackBuffer(const ::basegfx::B2ISize &rNewSize)
css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
void notifySizeUpdate(const css::awt::Rectangle &rBounds)
SpriteCanvas * mpSpriteCanvas
Pointer to sprite canvas (owner of this helper), needed to create bitmaps.
void disposing()
Dispose all internal references.
Product of this component's factory.
const std::shared_ptr< canvas::ISurfaceProxyManager > & getSurfaceProxy() const
css::uno::Any isAccelerated() const