Kaydet (Commit) 0b2637dd authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

remove mfAlpha again

The concept with separate alpha will result in nasty alpha bugs.

Change-Id: I9c18d2a850aeed2bf14f43d247029204013d3c93
üst 1c8fb3bd
...@@ -505,21 +505,23 @@ void DummyCircle::render() ...@@ -505,21 +505,23 @@ void DummyCircle::render()
SAL_WARN("chart2.opengl", "render DummyCircle"); SAL_WARN("chart2.opengl", "render DummyCircle");
debugProperties(maProperties); debugProperties(maProperties);
DummyChart* pChart = getRootShape(); 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()) if(itr != maProperties.end())
{ {
sal_Int32 nColor = itr->second.get<sal_Int32>(); sal_Int32 nTrans = itr->second.get<sal_Int32>();
pChart->m_GLRender.SetColor(nColor, 255); 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()) if(itr != maProperties.end())
{ {
sal_Int32 nTrans = itr->second.get<sal_Int32>(); sal_Int32 nColor = itr->second.get<sal_Int32>();
pChart->m_GLRender.SetTransparency(nTrans&0xFF); pChart->m_GLRender.SetColor(nColor, nAlpha);
} }
else
SAL_WARN("chart2.opengl", "missing color");
pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y, pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y,
maSize.Width, maSize.Height); maSize.Width, maSize.Height);
......
...@@ -1552,11 +1552,7 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient) ...@@ -1552,11 +1552,7 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient)
m_BackgroundColor[15] = 0.0; 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) void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadius, double nAngleStart, double nAngleWidth)
{ {
double nAngleStep = 1; double nAngleStep = 1;
......
...@@ -191,7 +191,6 @@ public: ...@@ -191,7 +191,6 @@ public:
#endif #endif
void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_uInt8 nAlpha); void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, sal_uInt8 nAlpha);
void SetTransparency(sal_uInt32 transparency);
private: private:
GLint LoadShaders(const OUString& rVertexShaderName, const OUString& rFragmentShaderName); GLint LoadShaders(const OUString& rVertexShaderName, const OUString& rFragmentShaderName);
int CreateTextureObj(int width, int height); int CreateTextureObj(int width, int height);
...@@ -294,7 +293,6 @@ private: ...@@ -294,7 +293,6 @@ private:
GLuint m_DebugVertexID; GLuint m_DebugVertexID;
GLuint m_DebugColorID; GLuint m_DebugColorID;
#endif #endif
float m_fAlpha;
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment