diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 11:54:32 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 11:54:32 +0000 |
commit | d0ca801b1ebf8e6e13a31e11cfc81fc0e816b0e0 (patch) | |
tree | f7bc59cb5f3c5f1230b7587cb634f69614607e03 /canvas | |
parent | d4f714345ab5875b1668d1df50fe5207175dfe04 (diff) |
INTEGRATION: CWS canvas02 (1.1.2); FILE ADDED
2005/10/11 15:41:18 thb 1.1.2.4: #i54170# Corrected license headers
2005/10/07 23:05:04 thb 1.1.2.3: #i48939# Unified formatting; improved constness; avoided a few copy constructions; pruned debug code; removed empty destructors; moved end iterator queries out of the loops
2005/09/29 14:19:36 mbu 1.1.2.2: pagemanager validates hardware surfaces now and handles this case properly
2005/09/29 09:40:34 mbu 1.1.2.1: surfaceproxy now has completely redesigned strategy, does no longer depend on amount of available videomemory
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/tools/pagemanager.hxx | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/canvas/source/tools/pagemanager.hxx b/canvas/source/tools/pagemanager.hxx new file mode 100644 index 000000000000..5de48b995b4a --- /dev/null +++ b/canvas/source/tools/pagemanager.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: pagemanager.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: kz $ $Date: 2005-11-02 12:54:32 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_CANVAS_PAGEMANAGER_HXX +#define INCLUDED_CANVAS_PAGEMANAGER_HXX + +#ifndef _BGFX_VECTOR_B2ISIZE_HXX +#include <basegfx/vector/b2isize.hxx> +#endif +#ifndef INCLUDED_CANVAS_IRENDERMODULE_HXX +#include <canvas/rendering/irendermodule.hxx> +#endif +#ifndef INCLUDED_CANVAS_ISURFACE_HXX +#include <canvas/rendering/isurface.hxx> +#endif + +#include "page.hxx" + +namespace canvas +{ + + ////////////////////////////////////////////////////////////////////////////////// + // PageManager + ////////////////////////////////////////////////////////////////////////////////// + + class PageManager + { + public: + PageManager( const canvas::IRenderModuleSharedPtr pRenderModule ) : + mpRenderModule(pRenderModule) + { + } + + // returns the maximum size of a hardware + // accelerated page, e.g. OpenGL texture. + ::basegfx::B2ISize getPageSize() const; + + canvas::IRenderModuleSharedPtr getRenderModule() const; + + FragmentSharedPtr allocateSpace( const ::basegfx::B2ISize& rSize ); + void free( const FragmentSharedPtr& pFragment ); + + void nakedFragment( const FragmentSharedPtr& pFragment ); + + void validatePages(); + + private: + // the pagemanager needs access to the rendermodule + // since we query for system resources from it. + canvas::IRenderModuleSharedPtr mpRenderModule; + + // here we collect all fragments that will be created + // since we need them for relocation purposes. + typedef std::list<FragmentSharedPtr> FragmentContainer_t; + FragmentContainer_t maFragments; + + // this is the container holding all created pages, + // behind the scenes these are real hardware surfaces. + typedef std::list<PageSharedPtr> PageContainer_t; + PageContainer_t maPages; + + bool relocate( const FragmentSharedPtr& pFragment ); + }; + + ////////////////////////////////////////////////////////////////////////////////// + // PageManagerSharedPtr + ////////////////////////////////////////////////////////////////////////////////// + + typedef ::boost::shared_ptr< PageManager > PageManagerSharedPtr; + + ////////////////////////////////////////////////////////////////////////////////// + // End of file + ////////////////////////////////////////////////////////////////////////////////// +} + +#endif |