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
b7bbc239
Kaydet (Commit)
b7bbc239
authored
Kas 06, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
Kas 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
MSVC does not support VLA
Change-Id: I46654d81b99051f764d829a262a14f8f0c5f536b
üst
482faead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
gdiimpl.cxx
vcl/opengl/gdiimpl.cxx
+14
-12
No files found.
vcl/opengl/gdiimpl.cxx
Dosyayı görüntüle @
b7bbc239
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
#include "opengl/salbmp.hxx"
#include "opengl/salbmp.hxx"
#include <vector>
#define GL_ATTRIB_POS 0
#define GL_ATTRIB_POS 0
#define GL_ATTRIB_TEX 1
#define GL_ATTRIB_TEX 1
...
@@ -272,17 +274,17 @@ void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 )
...
@@ -272,17 +274,17 @@ void OpenGLSalGraphicsImpl::DrawLine( long nX1, long nY1, long nX2, long nY2 )
void
OpenGLSalGraphicsImpl
::
DrawLines
(
sal_uInt32
nPoints
,
const
SalPoint
*
pPtAry
,
bool
bClose
)
void
OpenGLSalGraphicsImpl
::
DrawLines
(
sal_uInt32
nPoints
,
const
SalPoint
*
pPtAry
,
bool
bClose
)
{
{
GLfloat
pPoints
[
nPoints
*
2
]
;
std
::
vector
<
GLfloat
>
aPoints
(
nPoints
*
2
)
;
sal_uInt32
i
,
j
;
sal_uInt32
i
,
j
;
for
(
i
=
0
,
j
=
0
;
i
<
nPoints
;
i
++
)
for
(
i
=
0
,
j
=
0
;
i
<
nPoints
;
i
++
)
{
{
p
Points
[
j
++
]
=
(
2
*
pPtAry
[
i
].
mnX
)
/
GetWidth
()
-
1.0
;
a
Points
[
j
++
]
=
(
2
*
pPtAry
[
i
].
mnX
)
/
GetWidth
()
-
1.0
;
p
Points
[
j
++
]
=
(
2
*
pPtAry
[
i
].
mnY
)
/
GetHeight
()
-
1.0
;
a
Points
[
j
++
]
=
(
2
*
pPtAry
[
i
].
mnY
)
/
GetHeight
()
-
1.0
;
}
}
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
nPoints
*
2
,
GL_FLOAT
,
GL_FALSE
,
0
,
pPoints
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
nPoints
*
2
,
GL_FLOAT
,
GL_FALSE
,
0
,
&
aPoints
[
0
]
);
if
(
bClose
)
if
(
bClose
)
glDrawArrays
(
GL_LINE_LOOP
,
0
,
nPoints
);
glDrawArrays
(
GL_LINE_LOOP
,
0
,
nPoints
);
else
else
...
@@ -292,17 +294,17 @@ void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAr
...
@@ -292,17 +294,17 @@ void OpenGLSalGraphicsImpl::DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAr
void
OpenGLSalGraphicsImpl
::
DrawConvexPolygon
(
sal_uInt32
nPoints
,
const
SalPoint
*
pPtAry
)
void
OpenGLSalGraphicsImpl
::
DrawConvexPolygon
(
sal_uInt32
nPoints
,
const
SalPoint
*
pPtAry
)
{
{
GLfloat
pVertices
[
nPoints
*
2
]
;
std
::
vector
<
GLfloat
>
aVertices
(
nPoints
*
2
)
;
sal_uInt32
i
,
j
;
sal_uInt32
i
,
j
;
for
(
i
=
0
,
j
=
0
;
i
<
nPoints
;
i
++
,
j
+=
2
)
for
(
i
=
0
,
j
=
0
;
i
<
nPoints
;
i
++
,
j
+=
2
)
{
{
p
Vertices
[
j
]
=
(
2
*
pPtAry
[
i
].
mnX
)
/
GetWidth
()
-
1.0
;
a
Vertices
[
j
]
=
(
2
*
pPtAry
[
i
].
mnX
)
/
GetWidth
()
-
1.0
;
p
Vertices
[
j
+
1
]
=
(
2
*
pPtAry
[
i
].
mnY
)
/
GetHeight
()
-
1.0
;
a
Vertices
[
j
+
1
]
=
(
2
*
pPtAry
[
i
].
mnY
)
/
GetHeight
()
-
1.0
;
}
}
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
2
,
GL_FLOAT
,
GL_FALSE
,
0
,
pVertices
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
2
,
GL_FLOAT
,
GL_FALSE
,
0
,
&
aVertices
[
0
]
);
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
nPoints
);
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
nPoints
);
glDisableVertexAttribArray
(
GL_ATTRIB_POS
);
glDisableVertexAttribArray
(
GL_ATTRIB_POS
);
}
}
...
@@ -338,18 +340,18 @@ void OpenGLSalGraphicsImpl::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPt
...
@@ -338,18 +340,18 @@ void OpenGLSalGraphicsImpl::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPt
{
{
const
::
basegfx
::
B2DPolygon
&
aResult
(
const
::
basegfx
::
B2DPolygon
&
aResult
(
::
basegfx
::
triangulator
::
triangulate
(
aPolygon
)
);
::
basegfx
::
triangulator
::
triangulate
(
aPolygon
)
);
GLushort
pVertices
[
aResult
.
count
()
*
2
]
;
std
::
vector
<
GLushort
>
aVertices
(
aResult
.
count
()
*
2
)
;
sal_uInt32
j
(
0
);
sal_uInt32
j
(
0
);
for
(
sal_uInt32
i
=
0
;
i
<
aResult
.
count
();
i
++
)
for
(
sal_uInt32
i
=
0
;
i
<
aResult
.
count
();
i
++
)
{
{
const
::
basegfx
::
B2DPoint
&
rPt
(
aResult
.
getB2DPoint
(
i
)
);
const
::
basegfx
::
B2DPoint
&
rPt
(
aResult
.
getB2DPoint
(
i
)
);
p
Vertices
[
j
++
]
=
rPt
.
getX
();
a
Vertices
[
j
++
]
=
rPt
.
getX
();
p
Vertices
[
j
++
]
=
rPt
.
getY
();
a
Vertices
[
j
++
]
=
rPt
.
getY
();
}
}
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glEnableVertexAttribArray
(
GL_ATTRIB_POS
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
2
,
GL_UNSIGNED_SHORT
,
GL_FALSE
,
0
,
pVertices
);
glVertexAttribPointer
(
GL_ATTRIB_POS
,
2
,
GL_UNSIGNED_SHORT
,
GL_FALSE
,
0
,
&
aVertices
[
0
]
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
aResult
.
count
()
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
aResult
.
count
()
);
glDisableVertexAttribArray
(
GL_ATTRIB_POS
);
glDisableVertexAttribArray
(
GL_ATTRIB_POS
);
}
}
...
...
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