Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
test-helpers.cc File Reference
#include "test-helpers.hh"
#include <utility>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <scroom/colormappable.hh>
#include <scroom/layeroperations.hh>
#include "scroom/cairo-helpers.hh"
Include dependency graph for test-helpers.cc:

Functions

bool quit ()
 
bool reset ()
 
bool wait ()
 
bool setupTest1bpp (int zoom, int width, int height)
 
bool setupTest2bpp (int zoom, int width, int height)
 
bool setupTest4bpp (int zoom, int width, int height)
 
bool setupTest8bpp (int zoom, int width, int height)
 
bool setupTest8bppColormapped (int zoom, int width, int height)
 

Variables

int drawingAreaWidth = 0
 
int drawingAreaHeight = 0
 
TestData::Ptr testData
 

Function Documentation

◆ quit()

bool quit ( )
125{
126 gtk_main_quit();
127
128 return false;
129}

Referenced by init_tests().

Here is the caller graph for this function:

◆ reset()

bool reset ( )
132{
133 testData.reset();
134
135 return false;
136}
TestData::Ptr testData
Definition test-helpers.cc:25

Referenced by init_tests().

Here is the caller graph for this function:

◆ setupTest1bpp()

bool setupTest1bpp ( int  zoom,
int  width,
int  height 
)
151{
154
155 LayerSpec ls;
156 ls.push_back(Operations1bpp::create(colormapProvider));
157 ls.push_back(Operations8bpp::create(colormapProvider));
158
159 TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
160 SourcePresentation::Ptr const sp(new Source1Bpp());
161 tbi->setSource(sp);
162
163 testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
164
165 return false;
166}
std::shared_ptr< Colormap > Ptr
Definition colormappable.hh:29
static Colormap::Ptr createDefault(int n)
Definition colormappable.hh:49
std::shared_ptr< DummyColormapProvider > Ptr
Definition test-helpers.hh:27
static Ptr create(Colormap::Ptr colormap)
Definition test-helpers.cc:34
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition layeroperations.cc:262
static Ptr create(ColormapProvider::Ptr colormapProvider)
Definition layeroperations.cc:381
Definition measure-framerate-stubs.hh:72
std::shared_ptr< SourcePresentation > Ptr
Definition tiledbitmapinterface.hh:192
static Ptr create(DummyColormapProvider::Ptr colormapProvider, const LayerSpec &ls, const TiledBitmapInterface::Ptr &tbi, SourcePresentation::Ptr sp, int zoom)
Definition test-helpers.cc:61
std::shared_ptr< TiledBitmapInterface > Ptr
Definition tiledbitmapinterface.hh:233
Colormap::Ptr const colormap
Definition colormaphelpers_test.cc:55
std::vector< LayerOperations::Ptr > LayerSpec
Definition tiledbitmapinterface.hh:184
TiledBitmapInterface::Ptr createTiledBitmap(int bitmapWidth, int bitmapHeight, LayerSpec const &ls)
Definition tiled-bitmap.cc:28

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest2bpp()

bool setupTest2bpp ( int  zoom,
int  width,
int  height 
)
169{
172
173 LayerSpec ls;
174 ls.push_back(Operations::create(colormapProvider, 2));
175 ls.push_back(OperationsColormapped::create(colormapProvider, 2));
176
177 TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
178 SourcePresentation::Ptr const sp(new Source2Bpp());
179 tbi->setSource(sp);
180
181 testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
182
183 return false;
184}
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition layeroperations.cc:731
static Ptr create(ColormapProvider::Ptr colormapProvider, int bpp)
Definition layeroperations.cc:579
Definition measure-framerate-stubs.hh:80

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest4bpp()

bool setupTest4bpp ( int  zoom,
int  width,
int  height 
)
187{
190
191 LayerSpec ls;
192 ls.push_back(Operations::create(colormapProvider, 4));
193 ls.push_back(OperationsColormapped::create(colormapProvider, 4));
194
195 TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
196 SourcePresentation::Ptr const sp(new Source4Bpp());
197 tbi->setSource(sp);
198
199 testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
200
201 return false;
202}
Definition measure-framerate-stubs.hh:88

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest8bpp()

bool setupTest8bpp ( int  zoom,
int  width,
int  height 
)
205{
208
209 LayerSpec ls;
210 ls.push_back(Operations8bpp::create(colormapProvider));
211
212 TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
213 SourcePresentation::Ptr const sp(new Source8Bpp());
214 tbi->setSource(sp);
215
216 testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
217
218 return false;
219}
Definition measure-framerate-stubs.hh:96

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTest8bppColormapped()

bool setupTest8bppColormapped ( int  zoom,
int  width,
int  height 
)
222{
225
226 LayerSpec ls;
227 ls.push_back(Operations::create(colormapProvider, 8));
228 ls.push_back(OperationsColormapped::create(colormapProvider, 8));
229
230 TiledBitmapInterface::Ptr const tbi = createTiledBitmap(width, height, ls);
231 SourcePresentation::Ptr const sp(new Source8Bpp());
232 tbi->setSource(sp);
233
234 testData = TestData::create(colormapProvider, ls, tbi, sp, zoom);
235
236 return false;
237}

Referenced by init_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait()

bool wait ( )
139{
140 if(testData)
141 {
142 return testData->wait();
143 }
144
145 return false;
146}

Referenced by init_tests().

Here is the caller graph for this function:

Variable Documentation

◆ drawingAreaHeight

int drawingAreaHeight = 0

◆ drawingAreaWidth

int drawingAreaWidth = 0

◆ testData