Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1c8fb3bd
Kaydet (Commit)
1c8fb3bd
authored
Mar 03, 2014
tarafından
Peilin
Kaydeden (comit)
Markus Mohrhard
Mar 04, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add black bubble edge and modify transparence
Change-Id: If18e74c2cec00d29bddaffbbd21991749490493a
üst
62d6252d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
DummyXShape.cxx
chart2/source/view/main/DummyXShape.cxx
+7
-0
OpenGLRender.cxx
chart2/source/view/main/OpenGLRender.cxx
+29
-1
OpenGLRender.hxx
chart2/source/view/main/OpenGLRender.hxx
+2
-2
No files found.
chart2/source/view/main/DummyXShape.cxx
Dosyayı görüntüle @
1c8fb3bd
...
@@ -514,6 +514,13 @@ void DummyCircle::render()
...
@@ -514,6 +514,13 @@ void DummyCircle::render()
else
else
SAL_WARN
(
"chart2.opengl"
,
"missing color"
);
SAL_WARN
(
"chart2.opengl"
,
"missing color"
);
itr
=
maProperties
.
find
(
"FillTransparence"
);
if
(
itr
!=
maProperties
.
end
())
{
sal_Int32
nTrans
=
itr
->
second
.
get
<
sal_Int32
>
();
pChart
->
m_GLRender
.
SetTransparency
(
nTrans
&
0xFF
);
}
pChart
->
m_GLRender
.
Bubble2DShapePoint
(
maPosition
.
X
,
maPosition
.
Y
,
pChart
->
m_GLRender
.
Bubble2DShapePoint
(
maPosition
.
X
,
maPosition
.
Y
,
maSize
.
Width
,
maSize
.
Height
);
maSize
.
Width
,
maSize
.
Height
);
pChart
->
m_GLRender
.
RenderBubble2FBO
(
GL_TRUE
);
pChart
->
m_GLRender
.
RenderBubble2FBO
(
GL_TRUE
);
...
...
chart2/source/view/main/OpenGLRender.cxx
Dosyayı görüntüle @
1c8fb3bd
...
@@ -1044,6 +1044,7 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
...
@@ -1044,6 +1044,7 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
int
OpenGLRender
::
RenderBubble2FBO
(
int
)
int
OpenGLRender
::
RenderBubble2FBO
(
int
)
{
{
CHECK_GL_ERROR
();
CHECK_GL_ERROR
();
glm
::
vec4
edgeColor
=
glm
::
vec4
(
0.0
,
0.0
,
0.0
,
1.0
);
size_t
listNum
=
m_Bubble2DShapePointList
.
size
();
size_t
listNum
=
m_Bubble2DShapePointList
.
size
();
for
(
size_t
i
=
0
;
i
<
listNum
;
i
++
)
for
(
size_t
i
=
0
;
i
<
listNum
;
i
++
)
{
{
...
@@ -1082,7 +1083,30 @@ int OpenGLRender::RenderBubble2FBO(int)
...
@@ -1082,7 +1083,30 @@ int OpenGLRender::RenderBubble2FBO(int)
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
m_Bubble2DCircle
.
size
()
/
2
);
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
m_Bubble2DCircle
.
size
()
/
2
);
glDisableVertexAttribArray
(
m_2DVertexID
);
glDisableVertexAttribArray
(
m_2DVertexID
);
glUseProgram
(
0
);
glUseProgram
(
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
//add black edge
glLineWidth
(
3.0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_VertexBuffer
);
glBufferData
(
GL_ARRAY_BUFFER
,
m_Bubble2DCircle
.
size
()
*
sizeof
(
GLfloat
)
-
2
,
&
m_Bubble2DCircle
[
2
],
GL_STATIC_DRAW
);
glUseProgram
(
m_CommonProID
);
glUniform4fv
(
m_2DColorID
,
1
,
&
edgeColor
[
0
]);
glUniformMatrix4fv
(
m_MatrixID
,
1
,
GL_FALSE
,
&
m_MVP
[
0
][
0
]);
glEnableVertexAttribArray
(
m_2DVertexID
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_VertexBuffer
);
glVertexAttribPointer
(
m_2DVertexID
,
// attribute. No particular reason for 0, but must match the layout in the shader.
2
,
// size
GL_FLOAT
,
// type
GL_FALSE
,
// normalized?
0
,
// stride
(
void
*
)
0
// array buffer offset
);
glDrawArrays
(
GL_LINE_STRIP
,
0
,
(
m_Bubble2DCircle
.
size
()
*
sizeof
(
GLfloat
)
-
2
)
/
sizeof
(
float
)
/
2
);
glDisableVertexAttribArray
(
m_2DVertexID
);
glUseProgram
(
0
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
m_Bubble2DShapePointList
.
pop_front
();
m_Bubble2DShapePointList
.
pop_front
();
glLineWidth
(
m_fLineWidth
);
}
}
//if use MSAA, we should copy the data to the FBO texture
//if use MSAA, we should copy the data to the FBO texture
GLenum
fbResult
=
glCheckFramebufferStatus
(
GL_FRAMEBUFFER
);
GLenum
fbResult
=
glCheckFramebufferStatus
(
GL_FRAMEBUFFER
);
...
@@ -1528,7 +1552,11 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient)
...
@@ -1528,7 +1552,11 @@ 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
;
...
...
chart2/source/view/main/OpenGLRender.hxx
Dosyayı görüntüle @
1c8fb3bd
...
@@ -191,7 +191,7 @@ public:
...
@@ -191,7 +191,7 @@ 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 +294,7 @@ private:
...
@@ -294,7 +294,7 @@ 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: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment