diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-03-04 21:33:17 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-03-04 21:34:26 +0100 |
commit | 0b2637dda47690da69f748119081151f41fe4133 (patch) | |
tree | 330aae8d33804cb1ca6c05d3597ebb6e8018e171 /chart2 | |
parent | 1c8fb3bd1137c1ab922b840bef5748abbbe6531e (diff) |
remove mfAlpha again
The concept with separate alpha will result in nasty alpha bugs.
Change-Id: I9c18d2a850aeed2bf14f43d247029204013d3c93
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 18 | ||||
-rwxr-xr-x | chart2/source/view/main/OpenGLRender.cxx | 6 | ||||
-rwxr-xr-x | chart2/source/view/main/OpenGLRender.hxx | 2 |
3 files changed, 11 insertions, 15 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 036b306c6a53..493eb839c3a4 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -505,21 +505,23 @@ void DummyCircle::render() SAL_WARN("chart2.opengl", "render DummyCircle"); debugProperties(maProperties); DummyChart* pChart = getRootShape(); - std::map<OUString, uno::Any>::const_iterator itr = maProperties.find("FillColor"); + + sal_uInt8 nAlpha = 255; + std::map<OUString, uno::Any>::const_iterator itr = maProperties.find("FillTransparence"); if(itr != maProperties.end()) { - sal_Int32 nColor = itr->second.get<sal_Int32>(); - pChart->m_GLRender.SetColor(nColor, 255); + sal_Int32 nTrans = itr->second.get<sal_Int32>(); + nAlpha = static_cast<sal_uInt8>(nTrans & 0xFF); } - else - SAL_WARN("chart2.opengl", "missing color"); - itr = maProperties.find("FillTransparence"); + itr = maProperties.find("FillColor"); if(itr != maProperties.end()) { - sal_Int32 nTrans = itr->second.get<sal_Int32>(); - pChart->m_GLRender.SetTransparency(nTrans&0xFF); + sal_Int32 nColor = itr->second.get<sal_Int32>(); + pChart->m_GLRender.SetColor(nColor, nAlpha); } + else + SAL_WARN("chart2.opengl", "missing color"); pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y, maSize.Width, maSize.Height); diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 396ac94c4a76..55ce9d50b865 100755 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -1552,11 +1552,7 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient) m_BackgroundColor[15] = 0.0; } } -void OpenGLRender::SetTransparency(sal_uInt32 transparency) -{ - m_fAlpha = (float)transparency / 255.0; - m_2DColor = glm::vec4(m_2DColor.r, m_2DColor.g, m_2DColor.b, m_fAlpha); -} + void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadius, double nAngleStart, double nAngleWidth) { double nAngleStep = 1; diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx index ab1da1ecd7dd..ca999e2864f6 100755 --- a/chart2/source/view/main/OpenGLRender.hxx +++ b/chart2/source/view/main/OpenGLRender.hxx @@ -191,7 +191,6 @@ public: #endif void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_uInt8 nAlpha); - void SetTransparency(sal_uInt32 transparency); private: GLint LoadShaders(const OUString& rVertexShaderName, const OUString& rFragmentShaderName); int CreateTextureObj(int width, int height); @@ -294,7 +293,6 @@ private: GLuint m_DebugVertexID; GLuint m_DebugColorID; #endif - float m_fAlpha; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |