all repos — fluxbox @ 92deeba2a099ff93c0a766b2aa46454d62b19d8e

custom fork of the fluxbox windowmanager

Render rectangles instead of squares to test TextureRender.cc
Mathias Gumz akira at fluxbox dot org
commit

92deeba2a099ff93c0a766b2aa46454d62b19d8e

parent

3f30cbb2aec9a35eaa06e2b9bb9bf25d889c60de

1 files changed, 9 insertions(+), 13 deletions(-)

jump to
M src/tests/texturetest.ccsrc/tests/texturetest.cc

@@ -32,12 +32,12 @@

class Application: public FbTk::FbWindow, public FbTk::EventHandler { public: Application(int box_size, int num): - FbWindow(0, 0, 0, 640, box_size*num/8 - 3*5, ExposureMask | KeyPressMask), + FbWindow(0, 0, 0, 640, ((5+box_size)*num)/9 + 5, ExposureMask | KeyPressMask), m_box_size(box_size), m_num(num), m_font("fixed"), m_imgctrl(screenNumber()), - m_background(*this, 640, 480, depth()), + m_background(*this, width(), height(), depth()), m_gc(m_background) { setName("Texture Test"); setBackgroundPixmap(m_background.drawable());

@@ -58,13 +58,13 @@

private: void renderPixmap(const Texture &text, int x, int y) { - Pixmap pm = m_imgctrl.renderImage(m_box_size, m_box_size, + Pixmap pm = m_imgctrl.renderImage(2*m_box_size, m_box_size, text); m_background.copyArea(pm, m_gc.gc(), 0, 0, x, y, - m_box_size, m_box_size); + 2*m_box_size, m_box_size); m_imgctrl.removeImage(pm); }

@@ -87,17 +87,13 @@ std::auto_ptr<ThemeItem<Texture> > text;

char value[18]; for (int i=0; i<m_num; ++i) { sprintf(value, "%d", i); - text.reset(new ThemeItem<Texture> - (tm, - string("texture") + value, - string("Texture") + value)); - // load new style + text.reset(new ThemeItem<Texture> (tm, string("texture") + value, string("Texture") + value)); + ThemeManager::instance().load("test.theme", ""); - renderPixmap(**text.get(), next_x, next_y); - next_x += step_size; - if (next_x + m_box_size > width()) { + next_x += (step_size + m_box_size); + if (next_x + 2*m_box_size > width()) { m_font.drawText(m_background, screenNumber(), m_gc.gc(),

@@ -122,7 +118,7 @@ FbTk::GContext m_gc;

}; int main(int argc, char **argv) { - int boxsize= 60; + int boxsize= 30; int num = 63; for (int i=1; i<argc; ++i) { if (strcmp(argv[i], "-boxsize") == 0 && i + 1 < argc)