/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** Output module interface for backend render implementations.
Implement this interface for each operating system- or library-specific rendering backend, which needs coupling with the canvas rendering framework (which can be shared between all backend implementations).
*/ struct IRenderModule
{ /** Type of primitive passed to the render module via pushVertex()
*/ enumclass PrimitiveType
{
Unknown,
Triangle,
Quad
};
This is typically the maximum texture size of the hardware, or some arbitrary limit if the backend is software.
*/ virtual ::basegfx::B2IVector getPageSize() = 0;
/** Create a (possibly hardware-accelerated) surface
@return a pointer to a surface, which is an abstraction of a piece of (possibly hardware-accelerated) texture memory.
*/ virtual std::shared_ptr<ISurface> createSurface( const ::basegfx::B2IVector& surfaceSize ) = 0;
/** Begin rendering the given primitive.
Each beginPrimitive() call must be matched with an endPrimitive() call.
*/ virtualvoid beginPrimitive( PrimitiveType eType ) = 0;
/** Finish rendering a primitive.
Each beginPrimitive() call must be matched with an endPrimitive() call.
*/ virtualvoid endPrimitive() = 0;
/** Add given vertex to current primitive
After issuing a beginPrimitive(), each pushVertex() adds a vertex to the active primitive.
*/ virtualvoid pushVertex( const Vertex& vertex ) = 0;
/** Query error status
@returns true, if an error occurred during primitive construction.
*/ virtualbool isError() = 0;
};
/// Little RAII wrapper for guarding access to IRenderModule interface class RenderModuleGuard
{ public: explicit RenderModuleGuard( std::shared_ptr<IRenderModule> xRenderModule ) :
mpRenderModule(std::move( xRenderModule ))
{
mpRenderModule->lock();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.