LibreOffice Module canvas (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
canvas::Surface Class Reference

surfaces denote occupied areas within pages. More...

#include <surface.hxx>

Collaboration diagram for canvas::Surface:
[legend]

Public Member Functions

 Surface (const PageManagerSharedPtr &rPageManager, const std::shared_ptr< IColorBuffer > &rColorBuffer, const ::basegfx::B2IPoint &rPos, const ::basegfx::B2ISize &rSize)
 
 ~Surface ()
 
void setColorBufferDirty ()
 
bool draw (double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DHomMatrix &rTransform)
 Render the surface content to screen. More...
 
bool drawRectangularArea (double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DRectangle &rArea, const ::basegfx::B2DHomMatrix &rTransform)
 Render the surface content to screen. More...
 
bool drawWithClip (double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DPolygon &rClipPoly, const ::basegfx::B2DHomMatrix &rTransform)
 Render the surface content to screen. More...
 

Private Member Functions

void prepareRendering ()
 
basegfx::B2DRectangle getUVCoords () const
 
basegfx::B2DRectangle getUVCoords (const ::basegfx::B2IPoint &rPos, const ::basegfx::B2ISize &rSize) const
 

Private Attributes

std::shared_ptr< IColorBuffermpColorBuffer
 
PageManagerSharedPtr mpPageManager
 
FragmentSharedPtr mpFragment
 
::basegfx::B2IPoint maSourceOffset
 
::basegfx::B2ISize maSize
 
bool mbIsDirty
 

Detailed Description

surfaces denote occupied areas within pages.

pages encapsulate the hardware buffers that contain image data which can be used for texturing. surfaces are areas within those pages.

Definition at line 44 of file surface.hxx.

Constructor & Destructor Documentation

canvas::Surface::Surface ( const PageManagerSharedPtr rPageManager,
const std::shared_ptr< IColorBuffer > &  rColorBuffer,
const ::basegfx::B2IPoint rPos,
const ::basegfx::B2ISize rSize 
)

Definition at line 30 of file surface.cxx.

canvas::Surface::~Surface ( )

Definition at line 43 of file surface.cxx.

References mpFragment, and mpPageManager.

Member Function Documentation

bool canvas::Surface::draw ( double  fAlpha,
const ::basegfx::B2DPoint rPos,
const ::basegfx::B2DHomMatrix rTransform 
)

Render the surface content to screen.

Parameters
fAlphaOverall alpha for content
rPosOutput position
rTransformOutput transformation (does not affect output position)

Definition at line 92 of file surface.cxx.

References basegfx::utils::createTranslateB2DHomMatrix(), basegfx::fround(), getUVCoords(), basegfx::B2ITuple::getX(), basegfx::B2ITuple::getY(), maSize, maSourceOffset, mpPageManager, prepareRendering(), canvas::IRenderModule::Quad, and canvas::Vertex::r.

bool canvas::Surface::drawRectangularArea ( double  fAlpha,
const ::basegfx::B2DPoint rPos,
const ::basegfx::B2DRectangle rArea,
const ::basegfx::B2DHomMatrix rTransform 
)

Render the surface content to screen.

Parameters
fAlphaOverall alpha for content
rPosOutput position
rAreaSubset of the surface to render. Coordinate system are surface area pixel, given area will be clipped to the surface bounds.
rTransformOutput transformation (does not affect output position)

Definition at line 187 of file surface.cxx.

References basegfx::utils::createTranslateB2DHomMatrix(), basegfx::fround(), getUVCoords(), basegfx::B2ITuple::getX(), basegfx::B2ITuple::getY(), maSize, maSourceOffset, max, min, mpFragment, mpPageManager, prepareRendering(), canvas::IRenderModule::Quad, canvas::Vertex::r, basegfx::B2ITuple::setX(), and basegfx::B2ITuple::setY().

bool canvas::Surface::drawWithClip ( double  fAlpha,
const ::basegfx::B2DPoint rPos,
const ::basegfx::B2DPolygon rClipPoly,
const ::basegfx::B2DHomMatrix rTransform 
)

Render the surface content to screen.

Parameters
fAlphaOverall alpha for content
rPosOutput position
rClipPolyClip polygon for the surface. The clip polygon is also subject to the output transformation.
rTransformOutput transformation (does not affect output position)

Definition at line 308 of file surface.cxx.

References canvas::Vertex::a, canvas::Vertex::b, basegfx::utils::clipTriangleListOnRange(), basegfx::B2DPolygon::count(), basegfx::fround(), canvas::Vertex::g, basegfx::B2DPolygon::getB2DPoint(), getUVCoords(), basegfx::B2ITuple::getX(), basegfx::B2DTuple::getX(), basegfx::B2ITuple::getY(), basegfx::B2DTuple::getY(), h, maSize, maSourceOffset, mpPageManager, prepareRendering(), canvas::Vertex::r, basegfx::B2DHomMatrix::translate(), canvas::IRenderModule::Triangle, canvas::Vertex::u, canvas::Vertex::v, w, canvas::Vertex::x, canvas::Vertex::y, and canvas::Vertex::z.

basegfx::B2DRectangle canvas::Surface::getUVCoords ( ) const
private
basegfx::B2DRectangle canvas::Surface::getUVCoords ( const ::basegfx::B2IPoint rPos,
const ::basegfx::B2ISize rSize 
) const
private

Definition at line 74 of file surface.cxx.

References mpPageManager.

void canvas::Surface::prepareRendering ( )
private

Definition at line 404 of file surface.cxx.

References maSize, maSourceOffset, mbIsDirty, mpColorBuffer, mpFragment, and mpPageManager.

Referenced by draw(), drawRectangularArea(), and drawWithClip().

void canvas::Surface::setColorBufferDirty ( )

Definition at line 49 of file surface.cxx.

References mbIsDirty.

Member Data Documentation

::basegfx::B2ISize canvas::Surface::maSize
private

Definition at line 132 of file surface.hxx.

Referenced by draw(), drawRectangularArea(), drawWithClip(), getUVCoords(), and prepareRendering().

::basegfx::B2IPoint canvas::Surface::maSourceOffset
private

Definition at line 126 of file surface.hxx.

Referenced by draw(), drawRectangularArea(), drawWithClip(), and prepareRendering().

bool canvas::Surface::mbIsDirty
private

Definition at line 134 of file surface.hxx.

Referenced by prepareRendering(), and setColorBufferDirty().

std::shared_ptr<IColorBuffer> canvas::Surface::mpColorBuffer
private

Definition at line 114 of file surface.hxx.

Referenced by prepareRendering().

FragmentSharedPtr canvas::Surface::mpFragment
private

Definition at line 120 of file surface.hxx.

Referenced by drawRectangularArea(), getUVCoords(), prepareRendering(), and ~Surface().

PageManagerSharedPtr canvas::Surface::mpPageManager
private

The documentation for this class was generated from the following files: