removed unused files from graphics_tests.

This commit is contained in:
rachytski 2013-01-24 16:58:32 +03:00 committed by Alex Zolotarev
parent 29e82380d5
commit 4a461d976c
8 changed files with 0 additions and 192 deletions

View file

@ -1,22 +0,0 @@
#include "../../testing/testing.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../glyph_cache.hpp"
UNIT_TEST(GlyphCacheTest_Main)
{
graphics::GlyphCache cache(graphics::GlyphCache::Params(
"unicode_blocks.txt",
"fonts_whitelist.txt",
"fonts_blacklist.txt",
200000,
false));
string const path = GetPlatform().WritableDir();
cache.addFont((path + "01_dejavusans.ttf").c_str());
shared_ptr<graphics::GlyphBitmap> g1 = cache.getGlyphBitmap(graphics::GlyphKey('#', 40, true, graphics::Color(255, 255, 255, 255)));
//g1->dump(GetPlatform().WritablePathForFile("#_mask.png").c_str());
shared_ptr<graphics::GlyphBitmap> g2 = cache.getGlyphBitmap(graphics::GlyphKey('#', 40, false, graphics::Color(0, 0, 0, 0)));
//g2->dump(GetPlatform().WritablePathForFile("#.png").c_str());
}

View file

@ -18,13 +18,6 @@ macx*: LIBS *= "-framework Foundation"
SOURCES += \
../../testing/testingmain.cpp \
texture_test.cpp \
resourcemanager_test.cpp \
skin_loader_test.cpp \
skin_test.cpp \
screengl_test.cpp \
thread_render.cpp \
opengl_test.cpp \
screenglglobal_test.cpp \
glyph_cache_test.cpp \
shape_renderer_test.cpp \

View file

@ -1,4 +0,0 @@
#include "../../base/SRC_FIRST.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../../testing/testing.hpp"

View file

@ -1,10 +0,0 @@
#include "../../testing/testing.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../resource_manager.hpp"
UNIT_TEST(ResourceManagerTest_Main)
{
GL_TEST_START;
};

View file

@ -1,13 +0,0 @@
#include "../../testing/testing.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../../platform/platform.hpp"
#include "../skin_loader.hpp"
#include "../resource_manager.hpp"
UNIT_TEST(SkinLoaderTest_Main)
{
GL_TEST_START;
// shared_ptr<graphics::ResourceManager> rm(new graphics::ResourceManager(graphics::ResourceManager::Params()));
// loadSkin(rm, "basic.skn");
};

View file

@ -1,37 +0,0 @@
#include "../../testing/testing.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../resource_manager.hpp"
#include "../pen.hpp"
#include "../../std/vector.hpp"
#include "../../platform/platform.hpp"
UNIT_TEST(SkinTest_Main)
{
GL_TEST_START;
/*shared_ptr<graphics::ResourceManager> rm(new graphics::ResourceManager(graphics::ResourceManager::Params()));
graphics::Skin * skin = loadSkin(rm, "basic.skn");
double p0 [] = {1, 1};
graphics::PenInfo penInfo0(graphics::Color(0xFF, 0, 0, 0xFF), 1, p0, 2, 0);
// skin->mapPenInfo(penInfo0);
double p1 [] = {10, 10, 20, 20};
graphics::PenInfo penInfo1(graphics::Color(0xFF, 0, 0, 0xFF), 40, p1, 4, 0);
double p2[] = {15, 15, 15, 40};
graphics::PenInfo penInfo2(graphics::Color(0, 0xFF, 0, 0xFF), 40, p2, 4, 0);
double p3[] = {5, 5, 45, 30};
graphics::PenInfo penInfo3(graphics::Color(0xFF, 0, 0xFF, 0xFF), 35, p3, 4, 0);
// skin->mapPenInfo(penInfo1);
// skin->mapPenInfo(penInfo2);
// Overflowing
// skin->mapPenInfo(penInfo3);
delete skin;*/
}

View file

@ -1,23 +0,0 @@
#include "../../base/SRC_FIRST.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../../testing/testing.hpp"
#include "../opengl/texture.hpp"
UNIT_TEST(TextureTest_Main)
{
GL_TEST_START;
graphics::gl::RGBA8Texture texture(256, 256);
texture.makeCurrent();
texture.lock();
graphics::gl::RGBA8Texture::view_t view = texture.view(256, 256);
for (size_t i = 0; i < texture.height(); ++i)
for (size_t j = 0; j < texture.width(); ++j)
{
view(i, j)[0] = 255;
view(i, j)[1] = 0;
view(i, j)[2] = 0;
view(i, j)[3] = 255;
}
texture.unlock();
};

View file

@ -1,76 +0,0 @@
#include "../../base/SRC_FIRST.hpp"
#include "../../graphics/opengl/utils.hpp"
#include "../../graphics/opengl/texture.hpp"
#include "../../graphics/screen.hpp"
#include "../../std/shared_ptr.hpp"
#include "../../qt_tstfrm/macros.hpp"
#include "../../base/thread.hpp"
namespace
{
struct RenderRoutine : public threads::IRoutine
{
shared_ptr<graphics::Screen> m_pScreen;
shared_ptr<qt::gl::RenderContext> m_renderContext;
int & m_globalCounter;
RenderRoutine(shared_ptr<graphics::Screen> pScreen,
shared_ptr<qt::gl::RenderContext> renderContext,
int & globalCounter)
: m_pScreen(pScreen),
m_renderContext(renderContext),
m_globalCounter(globalCounter)
{}
void Do()
{
m_renderContext->makeCurrent();
for (size_t i = 0; i < 30; ++i)
{
m_pScreen->beginFrame();
m_pScreen->clear(graphics::Screen::s_bgColor);
m_pScreen->immDrawRect(
m2::RectF(i * 15 + 20, 10, i * 15 + 30, 20),
m2::RectF(),
shared_ptr<graphics::gl::RGBA8Texture>(),
false,
graphics::Color(0, 0, 255, (m_globalCounter++) * (255 / 60)),
true);
m_pScreen->endFrame();
}
}
};
struct TestThreadedRendering
{
shared_ptr<qt::gl::RenderContext> m_renderContext;
int globalCounter;
void Init(shared_ptr<qt::gl::RenderContext> renderContext)
{
m_renderContext = renderContext;
globalCounter = 0;
}
void DoDraw(shared_ptr<graphics::Screen> p)
{
globalCounter = 0;
threads::Thread thread;
thread.Create(new RenderRoutine(p, m_renderContext, globalCounter));
for (size_t i = 0; i < 30; ++i)
{
p->beginFrame();
p->clear(graphics::Screen::s_bgColor);
p->immDrawSolidRect(
m2::RectF(i * 15 + 20, 30, i * 15 + 30, 40),
graphics::Color(0, 0, 255, (globalCounter++) * (255 / 60) ));
p->endFrame();
}
thread.Join();
}
};
// UNIT_TEST_GL(TestThreadedRendering);
}