diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 09:39:43 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 09:39:43 +0000 |
commit | d20f4a5bd71dac75095e2965a6807272ce7e5407 (patch) | |
tree | 04e723dc7565de71f88a9473ca69b714b67f3057 /canvas/source/directx/dx_surfacegraphics.hxx | |
parent | 5c29d717a1ea657d00cf8a64bfbbd1a860d46533 (diff) |
INTEGRATION: CWS canvas05 (1.2.2); FILE MERGED
2008/06/03 23:52:24 thb 1.2.2.4: Removed extra level of indirection for getting a graphics for a surface; removed some unused code
2008/04/21 07:30:45 thb 1.2.2.3: RESYNC: (1.2-1.3); FILE MERGED
2008/01/22 00:25:24 thb 1.2.2.2: #i81092# Making gdiplus and dx canvas more independent
2007/12/20 22:18:57 thb 1.2.2.1: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering
Diffstat (limited to 'canvas/source/directx/dx_surfacegraphics.hxx')
-rwxr-xr-x | canvas/source/directx/dx_surfacegraphics.hxx | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/canvas/source/directx/dx_surfacegraphics.hxx b/canvas/source/directx/dx_surfacegraphics.hxx index 83c3d5206282..696f2de338d3 100755 --- a/canvas/source/directx/dx_surfacegraphics.hxx +++ b/canvas/source/directx/dx_surfacegraphics.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dx_surfacegraphics.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -31,45 +31,18 @@ #ifndef _DXCANVAS_SURFACEGRAPHICS_HXX #define _DXCANVAS_SURFACEGRAPHICS_HXX -#include <boost/shared_ptr.hpp> -#include <boost/utility.hpp> +#include "dx_graphicsprovider.hxx" namespace dxcanvas { /** Container providing a Gdiplus::Graphics for a Surface This wrapper class transparently handles allocation and - release of surface resources the RAII way. Please don't create - yourself, the only legal way to obtain such an object is via - Surface::getGraphics() - - @see Surface::getGraphics() + release of surface resources the RAII way (the + GraphicsSharedPtr returned has a deleter that does all the + necessary DX cleanup work). */ - class SurfaceGraphics : private ::boost::noncopyable - { - public: - SurfaceGraphics(); - explicit SurfaceGraphics( HDC aHDC ); - explicit SurfaceGraphics( const BitmapSharedPtr& rBitmap ); - explicit SurfaceGraphics( const COMReference<surface_type>& rSurface ); - ~SurfaceGraphics(); - - bool is() const { return mpGraphics != NULL; } - Gdiplus::Graphics* get() { return mpGraphics; } - const Gdiplus::Graphics* get() const { return mpGraphics; } - Gdiplus::Graphics* operator->() { return mpGraphics; } - const Gdiplus::Graphics* operator->() const { return mpGraphics; } - Gdiplus::Graphics& operator*() { return *mpGraphics; } - const Gdiplus::Graphics& operator*() const { return *mpGraphics; } - - private: - COMReference<surface_type> mpSurface; - Gdiplus::Graphics* mpGraphics; - BitmapSharedPtr mpBitmap; - HDC maHDC; - }; - - typedef ::boost::shared_ptr< SurfaceGraphics > SurfaceGraphicsSharedPtr; + GraphicsSharedPtr createSurfaceGraphics(const COMReference<surface_type>& rSurface ); } #endif /* _DXCANVAS_SURFACEGRAPHICS_HXX */ |