LibreOffice Module libreofficekit (master) 1
|
This class represents the tile buffer which is responsible for managing, reusing and caching all the already rendered tiles. More...
#include <tilebuffer.hxx>
Public Member Functions | |
TileBuffer (int columns=0, int scale=1) | |
Tile & | getTile (int x, int y, GTask *task, GThreadPool *pool) |
Gets the underlying Tile object for given position. More... | |
void | setTile (int x, int y, cairo_surface_t *surface) |
bool | hasValidTile (int x, int y) |
Returns true if a valid tile exists at this location. More... | |
void | resetAllTiles () |
Destroys all the tiles in the tile buffer; also frees the memory allocated for all the Tile objects. More... | |
void | setInvalid (int x, int y, float zoom, GTask *task, GThreadPool *) |
Marks the tile as invalid. More... | |
Private Attributes | |
std::map< int, Tile > | m_mTiles |
Stores all the tiles cached by this tile buffer. More... | |
int | m_nWidth |
Width of the current tile buffer (number of columns) More... | |
Tile | m_DummyTile |
Dummy tile. More... | |
This class represents the tile buffer which is responsible for managing, reusing and caching all the already rendered tiles.
If the given tile is not present in the buffer, call to LOK Document's (m_pLOKDocument) paintTile method is made which fetches the rendered tile from LO core and store it in buffer for future reuse.
Definition at line 90 of file tilebuffer.hxx.
Definition at line 93 of file tilebuffer.hxx.
References m_DummyTile, nTileSizePixels, scale, and Tile::setSurface().
Gets the underlying Tile object for given position.
The position (0, 0) points to the left top most tile of the buffer.
If the tile is not cached by the tile buffer, it makes a paintTile call to LO core asking to render the given tile. It then stores the tile for future reuse.
x | the tile along the x-axis of the buffer |
y | the tile along the y-axis of the buffer |
task | GTask object containing the necessary data |
pool | GThreadPool managed by the widget instance used for all the LOK calls made by widget. It is needed here because getTile invokes one of the LOK call : paintTile. |
Definition at line 85 of file tilebuffer.cxx.
References index, m_DummyTile, m_mTiles, m_nWidth, x, and y.
void TileBuffer::resetAllTiles | ( | ) |
Destroys all the tiles in the tile buffer; also frees the memory allocated for all the Tile objects.
Definition at line 54 of file tilebuffer.cxx.
References m_mTiles.
Marks the tile as invalid.
The tile (0, 0) is the left topmost tile in the tile buffer.
x | the position of tile along x-axis |
y | the position of tile along y-axis |
zoom | zoom factor of the document |
task | GTask object containing the necessary data |
pool | GThreadPool managed by the widget instance used for all the LOK calls made by widget. It is needed here because setInvalid() invokes one of the LOK call : paintTile. |
Definition at line 62 of file tilebuffer.cxx.
References LOEvent::destroy(), index, LOK_PAINT_TILE, LOEvent::m_fPaintTileZoom, m_mTiles, LOEvent::m_nPaintTileX, LOEvent::m_nPaintTileY, m_nWidth, x, and y.
void TileBuffer::setTile | ( | int | x, |
int | y, | ||
cairo_surface_t * | surface | ||
) |
|
private |
Dummy tile.
Definition at line 152 of file tilebuffer.hxx.
Referenced by getTile(), and TileBuffer().
Stores all the tiles cached by this tile buffer.
Definition at line 148 of file tilebuffer.hxx.
Referenced by getTile(), hasValidTile(), resetAllTiles(), setInvalid(), and setTile().
|
private |
Width of the current tile buffer (number of columns)
Definition at line 150 of file tilebuffer.hxx.
Referenced by getTile(), hasValidTile(), setInvalid(), and setTile().