diff --git a/qt_tstfrm/macros.hpp b/qt_tstfrm/macros.hpp index 8046cf7e7d..10f0ce3ee5 100644 --- a/qt_tstfrm/macros.hpp +++ b/qt_tstfrm/macros.hpp @@ -105,6 +105,8 @@ class GLTestWidget : public tst::GLDrawWidget { TTest test; + typedef tst::GLDrawWidget base_type; + public: virtual void DoDraw(shared_ptr p) diff --git a/qt_tstfrm/tstwidgets.cpp b/qt_tstfrm/tstwidgets.cpp index 6777d123b6..53c63b7ec2 100644 --- a/qt_tstfrm/tstwidgets.cpp +++ b/qt_tstfrm/tstwidgets.cpp @@ -23,6 +23,7 @@ GLDrawWidget::GLDrawWidget() : base_type(0) GLDrawWidget::~GLDrawWidget() { + yg::gl::FinalizeThread(); } void GLDrawWidget::initializeGL() @@ -31,6 +32,7 @@ void GLDrawWidget::initializeGL() { yg::gl::InitExtensions(); yg::gl::CheckExtensionSupport(); + yg::gl::InitializeThread(); } catch (yg::gl::platform_unsupported & e) { @@ -163,15 +165,18 @@ void GLDrawWidget::resizeGL(int w, int h) m_renderTarget.reset(); m_renderTarget = make_shared_ptr(new yg::gl::RGBA8Texture(w, h)); - m_frameBuffer->setRenderTarget(m_renderTarget); + m_p->setRenderTarget(m_renderTarget); } void GLDrawWidget::paintGL() { - base_type::paintGL(); - // m_renderTarget->dump("renderTarget.png"); + m_p->beginFrame(); + m_p->clear(yg::Color(182, 182, 182, 255)); + DoDraw(m_p); + m_p->endFrame(); + m_primaryScreen->beginFrame(); m_primaryScreen->immDrawTexturedRect( diff --git a/yg/yg_tests/screengl_test.cpp b/yg/yg_tests/screengl_test.cpp index 09712efead..573fb2bd3a 100644 --- a/yg/yg_tests/screengl_test.cpp +++ b/yg/yg_tests/screengl_test.cpp @@ -1330,47 +1330,45 @@ namespace } }; -// UNIT_TEST_GL(TestDrawPolyOverflow); -// UNIT_TEST_GL(TestDrawText); -// UNIT_TEST_GL(TestDrawSingleSymbol); -// UNIT_TEST_GL(TestDrawEmptySymbol); -// UNIT_TEST_GL(TestDrawSingleSymbolAndSolidPath); -// UNIT_TEST_GL(TestDrawMultiLineStringWithPosition); -// UNIT_TEST_GL(TestDrawString); -// UNIT_TEST_GL(TestDrawStringWithFixedFont); -// UNIT_TEST_GL(TestDrawStringWithColor); -// UNIT_TEST_GL(TestDrawUnicodeSymbols); -// UNIT_TEST_GL(TestDrawTextRectWithFixedFont); -// UNIT_TEST_GL(TestDrawTextRect); -// UNIT_TEST_GL(TestDrawStringOnString); -// UNIT_TEST_GL(TestDrawTextOnPathInteractive); -// UNIT_TEST_GL(TestDrawTextOnPathBigSymbols); -// UNIT_TEST_GL(TestDrawTextOnPath); -// UNIT_TEST_GL(TestDrawTextOnPathZigZag); -// UNIT_TEST_GL(TestDrawTextOnPathWithOffset); -// UNIT_TEST_GL(TestDrawStraightTextElement); -// UNIT_TEST_GL(TestDrawPathTextElement); -// UNIT_TEST_GL(TestDrawTextOverflow); -// UNIT_TEST_GL(TestDrawTextFiltering); -// UNIT_TEST_GL(TestDrawRandomTextFiltering); + UNIT_TEST_GL(TestDrawPolyOverflow); + UNIT_TEST_GL(TestDrawText); + UNIT_TEST_GL(TestDrawSingleSymbol); + UNIT_TEST_GL(TestDrawEmptySymbol); + UNIT_TEST_GL(TestDrawSingleSymbolAndSolidPath); + UNIT_TEST_GL(TestDrawMultiLineStringWithPosition); + UNIT_TEST_GL(TestDrawString); + UNIT_TEST_GL(TestDrawStringWithColor); + UNIT_TEST_GL(TestDrawUnicodeSymbols); + UNIT_TEST_GL(TestDrawTextRect); + UNIT_TEST_GL(TestDrawStringOnString); + UNIT_TEST_GL(TestDrawTextOnPathInteractive); + UNIT_TEST_GL(TestDrawTextOnPathBigSymbols); + UNIT_TEST_GL(TestDrawTextOnPath); + UNIT_TEST_GL(TestDrawTextOnPathZigZag); + UNIT_TEST_GL(TestDrawTextOnPathWithOffset); + UNIT_TEST_GL(TestDrawStraightTextElement); + UNIT_TEST_GL(TestDrawPathTextElement); + UNIT_TEST_GL(TestDrawTextOverflow); + UNIT_TEST_GL(TestDrawTextFiltering); + UNIT_TEST_GL(TestDrawRandomTextFiltering); // UNIT_TEST_GL(TestDrawSGIConvex); -// UNIT_TEST_GL(TestDrawPoly); -// UNIT_TEST_GL(TestDrawSolidRect); -// UNIT_TEST_GL(TestDrawPathWithSkinPageMiss); + UNIT_TEST_GL(TestDrawPoly); + UNIT_TEST_GL(TestDrawSolidRect); + UNIT_TEST_GL(TestDrawPathWithSkinPageMiss); UNIT_TEST_GL(TestDrawPathWithOffset); -// UNIT_TEST_GL(TestDrawPathJoin); -// UNIT_TEST_GL(TestDrawPathSolid1PX); -// UNIT_TEST_GL(TestDrawPathSolid2PX); -// UNIT_TEST_GL(TestDrawPathSolid); -// UNIT_TEST_GL(TestDrawOverlappedSymbolWithText); -// UNIT_TEST_GL(TestDrawAnyRect); -// UNIT_TEST_GL(TestDrawSector); -// UNIT_TEST_GL(TestDrawPathSolidDiffWidth); -// UNIT_TEST_GL(TestDrawPathZigZag); -// UNIT_TEST_GL(TestDrawPathSolidWithZ); -// UNIT_TEST_GL(TestDrawPathSolidWithClipRect); -// UNIT_TEST_GL(TestDrawUtilsRect); -// UNIT_TEST_GL(TestDrawUtilsRectFilledTexture); -// UNIT_TEST_GL(TestDrawSymbolFiltering); -// UNIT_TEST_GL(TestDrawCircle); + UNIT_TEST_GL(TestDrawPathJoin); + UNIT_TEST_GL(TestDrawPathSolid1PX); + UNIT_TEST_GL(TestDrawPathSolid2PX); + UNIT_TEST_GL(TestDrawPathSolid); + UNIT_TEST_GL(TestDrawOverlappedSymbolWithText); + UNIT_TEST_GL(TestDrawAnyRect); + UNIT_TEST_GL(TestDrawSector); + UNIT_TEST_GL(TestDrawPathSolidDiffWidth); + UNIT_TEST_GL(TestDrawPathZigZag); + UNIT_TEST_GL(TestDrawPathSolidWithZ); + UNIT_TEST_GL(TestDrawPathSolidWithClipRect); + UNIT_TEST_GL(TestDrawUtilsRect); + UNIT_TEST_GL(TestDrawUtilsRectFilledTexture); + UNIT_TEST_GL(TestDrawSymbolFiltering); + UNIT_TEST_GL(TestDrawCircle); } diff --git a/yg/yg_tests/skin_loader_test.cpp b/yg/yg_tests/skin_loader_test.cpp index ecd31ea41e..b6053e4b8a 100644 --- a/yg/yg_tests/skin_loader_test.cpp +++ b/yg/yg_tests/skin_loader_test.cpp @@ -8,6 +8,6 @@ UNIT_TEST(SkinLoaderTest_Main) { GL_TEST_START; - shared_ptr rm(new yg::ResourceManager(yg::ResourceManager::Params())); - loadSkin(rm, "basic.skn"); +// shared_ptr rm(new yg::ResourceManager(yg::ResourceManager::Params())); +// loadSkin(rm, "basic.skn"); }; diff --git a/yg/yg_tests/skin_test.cpp b/yg/yg_tests/skin_test.cpp index 9c077a9fad..25455dd2a0 100644 --- a/yg/yg_tests/skin_test.cpp +++ b/yg/yg_tests/skin_test.cpp @@ -10,7 +10,7 @@ UNIT_TEST(SkinTest_Main) { GL_TEST_START; - shared_ptr rm(new yg::ResourceManager(yg::ResourceManager::Params())); + /*shared_ptr rm(new yg::ResourceManager(yg::ResourceManager::Params())); yg::Skin * skin = loadSkin(rm, "basic.skn"); double p0 [] = {1, 1}; @@ -33,6 +33,6 @@ UNIT_TEST(SkinTest_Main) // skin->mapPenInfo(penInfo3); - delete skin; + delete skin;*/ }