diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2013-01-25 13:20:15 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:49:20 +0300 |
commit | 8dd89a8fce7a1b357c7aa5333893d3a0c587a9b5 (patch) | |
tree | c38e4593fa8b3188f0da6f5075f4ed0da7edcede | |
parent | a36af611dfe56b41b31c0d060f61eea26356f1db (diff) |
fixed according to code review.
-rw-r--r-- | graphics/blitter.cpp | 5 | ||||
-rw-r--r-- | graphics/blitter.hpp | 3 | ||||
-rw-r--r-- | graphics/defines.hpp | 1 | ||||
-rw-r--r-- | graphics/opengl/renderer.cpp | 2 | ||||
-rw-r--r-- | graphics/path_text_element.cpp | 2 | ||||
-rw-r--r-- | graphics/render_target.cpp | 2 | ||||
-rw-r--r-- | graphics/straight_text_element.cpp | 2 | ||||
-rw-r--r-- | gui/element.hpp | 2 | ||||
-rw-r--r-- | gui/image_view.hpp | 7 | ||||
-rw-r--r-- | map/screen_coverage.cpp | 2 | ||||
-rw-r--r-- | qt_tstfrm/qt_tstfrm.pro | 4 |
11 files changed, 18 insertions, 14 deletions
diff --git a/graphics/blitter.cpp b/graphics/blitter.cpp index ae34f8971f..f46ea8f047 100644 --- a/graphics/blitter.cpp +++ b/graphics/blitter.cpp @@ -24,7 +24,8 @@ namespace graphics void Blitter::blit(BlitInfo const * blitInfo, size_t s, - bool isSubPixel) + bool isSubPixel, + double depth) { vector<m2::PointF> geomPts(4 * s); vector<m2::PointF> texPts(4 * s); @@ -67,7 +68,7 @@ namespace graphics { pointsData[i].pt.x = geomPts[i].x; pointsData[i].pt.y = geomPts[i].y; - pointsData[i].depth = graphics::maxDepth; + pointsData[i].depth = depth; pointsData[i].tex.x = texPts[i].x; pointsData[i].tex.y = texPts[i].y; pointsData[i].normal.x = 0; diff --git a/graphics/blitter.hpp b/graphics/blitter.hpp index 687fd82784..7fd5862c13 100644 --- a/graphics/blitter.hpp +++ b/graphics/blitter.hpp @@ -54,7 +54,8 @@ namespace graphics void blit(BlitInfo const * blitInfo, size_t s, - bool isSubPixel); + bool isSubPixel, + double depth); void immDrawSolidRect(m2::RectF const & rect, Color const & color); diff --git a/graphics/defines.hpp b/graphics/defines.hpp index b66a06578b..7cfd98f79b 100644 --- a/graphics/defines.hpp +++ b/graphics/defines.hpp @@ -3,6 +3,7 @@ namespace graphics { static const int maxDepth = 20000; + static const int minDepth = -20000; /// When adding values here, /// please check constructor of ResourceManager, diff --git a/graphics/opengl/renderer.cpp b/graphics/opengl/renderer.cpp index b2b4926207..d54971284e 100644 --- a/graphics/opengl/renderer.cpp +++ b/graphics/opengl/renderer.cpp @@ -67,7 +67,7 @@ namespace graphics 0, m_width, m_height, 0, -graphics::maxDepth, - graphics::maxDepth); + graphics::maxDepth + 1); if (m_frameBuffer) diff --git a/graphics/path_text_element.cpp b/graphics/path_text_element.cpp index e1a412ca88..397929a4a2 100644 --- a/graphics/path_text_element.cpp +++ b/graphics/path_text_element.cpp @@ -74,7 +74,7 @@ namespace graphics desc.m_isMasked = false; } - drawTextImpl(m_glyphLayout, screen, m, false, false, desc, depth()); + drawTextImpl(m_glyphLayout, screen, m, false, false, desc, depth() + 0.1); } void PathTextElement::setPivot(m2::PointD const & pivot) diff --git a/graphics/render_target.cpp b/graphics/render_target.cpp index d934f906f2..7e0b4315c2 100644 --- a/graphics/render_target.cpp +++ b/graphics/render_target.cpp @@ -9,6 +9,6 @@ namespace graphics void RenderTarget::coordMatrix(math::Matrix<float, 4, 4> & m) { - getOrthoMatrix(m, 0, width(), 0, height(), -maxDepth, maxDepth); + getOrthoMatrix(m, 0, width(), 0, height(), -maxDepth, maxDepth + 1); } } diff --git a/graphics/straight_text_element.cpp b/graphics/straight_text_element.cpp index 84a7f79247..bca0d9ed37 100644 --- a/graphics/straight_text_element.cpp +++ b/graphics/straight_text_element.cpp @@ -277,7 +277,7 @@ namespace graphics { graphics::FontDesc fontDesc = m_glyphLayouts[i].fontDesc(); fontDesc.m_isMasked = false; - drawTextImpl(m_glyphLayouts[i], screen, m, true, true, fontDesc, depth()); + drawTextImpl(m_glyphLayouts[i], screen, m, true, true, fontDesc, depth() + 0.1); } } diff --git a/gui/element.hpp b/gui/element.hpp index d495984225..fdfee77d93 100644 --- a/gui/element.hpp +++ b/gui/element.hpp @@ -26,7 +26,7 @@ namespace gui enum EState { - EInactive, + EInactive = 0, EActive, EPressed, ESelected diff --git a/gui/image_view.hpp b/gui/image_view.hpp index d2542831e9..607e9ed364 100644 --- a/gui/image_view.hpp +++ b/gui/image_view.hpp @@ -3,11 +3,12 @@ #include "element.hpp" #include "../graphics/image.hpp" -#include "../std/shared_ptr.hpp" +#include "../graphics/display_list.hpp" + +#include "../std/scoped_ptr.hpp" namespace graphics { - class DisplayList; class OverlayRenderer; } @@ -21,7 +22,7 @@ namespace gui graphics::Image::Info m_image; m2::RectU m_margin; - shared_ptr<graphics::DisplayList> m_displayList; + scoped_ptr<graphics::DisplayList> m_displayList; public: diff --git a/map/screen_coverage.cpp b/map/screen_coverage.cpp index c3f7ac13ab..13d51c6c2d 100644 --- a/map/screen_coverage.cpp +++ b/map/screen_coverage.cpp @@ -197,7 +197,7 @@ bool ScreenCoverage::Cache(core::CommandsQueue::Environment const & env) } if (!infos.empty()) - m_cacheScreen->blit(&infos[0], infos.size(), true); + m_cacheScreen->blit(&infos[0], infos.size(), true, graphics::minDepth); math::Matrix<double, 3, 3> idM = math::Identity<double, 3>(); diff --git a/qt_tstfrm/qt_tstfrm.pro b/qt_tstfrm/qt_tstfrm.pro index a69f3a6a1f..dc51b9a84f 100644 --- a/qt_tstfrm/qt_tstfrm.pro +++ b/qt_tstfrm/qt_tstfrm.pro @@ -12,8 +12,8 @@ QT *= core gui opengl HEADERS += \ tstwidgets.hpp \ macros.hpp \ - gl_test_widget.hpp \ - gui_test_widget.hpp + gl_test_widget.hpp \ + gui_test_widget.hpp \ SOURCES += \ tstwidgets.cpp \ |