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#pragma once
21
22#include <com/sun/star/awt/Rectangle.hpp>
23#include <com/sun/star/rendering/XGraphicDevice.hpp>
24#include <com/sun/star/rendering/XBufferController.hpp>
25
26#include "dx_rendermodule.hxx"
27#include "dx_surfacebitmap.hxx"
28#include "dx_devicehelper.hxx"
29
31
32
33namespace dxcanvas
34{
35 class SpriteCanvas;
36
38 {
39 public:
41
42 void init( vcl::Window& rWindow,
43 SpriteCanvas& rSpriteCanvas,
44 const css::awt::Rectangle& rRect,
45 bool bFullscreen );
46
48 void disposing();
49
50 // partial override XWindowGraphicDevice
51 css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(
52 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
53 const css::geometry::IntegerSize2D& size );
54 css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(
55 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
56 const css::geometry::IntegerSize2D& size );
57 css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(
58 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
59 const css::geometry::IntegerSize2D& size );
60 css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
61 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
62 const css::geometry::IntegerSize2D& size );
63
64 void destroyBuffers( );
65 bool showBuffer( bool bIsVisible, bool bUpdateAll );
66 bool switchBuffer( bool bIsVisible, bool bUpdateAll );
67
70 const std::shared_ptr<canvas::ISurfaceProxyManager> &getSurfaceProxy() const { return mpSurfaceProxyManager; }
71
72 css::uno::Any isAccelerated() const;
73
74 void notifySizeUpdate( const css::awt::Rectangle& rBounds );
75
79 void dumpScreenContent() const;
80
81 private:
82 void resizeBackBuffer( const ::basegfx::B2ISize& rNewSize );
83 HWND getHwnd() const;
84
87
89
91 std::shared_ptr<canvas::ISurfaceProxyManager> mpSurfaceProxyManager;
92
95 };
96}
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Product of this component's factory.
bool switchBuffer(bool bIsVisible, bool bUpdateAll)
IDXRenderModuleSharedPtr mpRenderModule
Our encapsulation interface to DirectX.
void notifySizeUpdate(const css::awt::Rectangle &rBounds)
void init(vcl::Window &rWindow, SpriteCanvas &rSpriteCanvas, const css::awt::Rectangle &rRect, bool bFullscreen)
void disposing()
Dispose all internal references.
SpriteCanvas * mpSpriteCanvas
Pointer to sprite canvas (owner of this helper), needed to create bitmaps.
const std::shared_ptr< canvas::ISurfaceProxyManager > & getSurfaceProxy() const
bool showBuffer(bool bIsVisible, bool bUpdateAll)
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
std::shared_ptr< canvas::ISurfaceProxyManager > mpSurfaceProxyManager
Instance passing out HW textures.
const DXSurfaceBitmapSharedPtr & getBackBuffer() const
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)
const IDXRenderModuleSharedPtr & getRenderModule() const
void dumpScreenContent() const
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of curren...
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr