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
396fa3b6
Kaydet (Commit)
396fa3b6
authored
Agu 08, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
Agu 08, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reimplement custom sprite rendering with FBO
Change-Id: I8d7a54fac61a3072d4f34615e71e37c70dec4e50
üst
d4b80b6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
13 deletions
+33
-13
ogl_buffercontext.hxx
canvas/source/opengl/ogl_buffercontext.hxx
+7
-2
ogl_canvascustomsprite.cxx
canvas/source/opengl/ogl_canvascustomsprite.cxx
+4
-3
ogl_spritedevicehelper.cxx
canvas/source/opengl/ogl_spritedevicehelper.cxx
+22
-8
No files found.
canvas/source/opengl/ogl_buffercontext.hxx
Dosyayı görüntüle @
396fa3b6
...
...
@@ -10,20 +10,25 @@
#ifndef INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BUFFERCONTEXT_HXX
#define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BUFFERCONTEXT_HXX
#include <GL/glew.h>
#include <sal/config.h>
#include <boost/shared_ptr.hpp>
namespace
oglcanvas
{
struct
IBufferContext
{
virtual
~
IBufferContext
()
{}
/// start render to buffer. changes
gl current context
/// start render to buffer. changes
current framebuffer
virtual
bool
startBufferRendering
()
=
0
;
/// end render to buffer. switches to
window context, and selects rendered texture
/// end render to buffer. switches to
default framebuffer
virtual
bool
endBufferRendering
()
=
0
;
virtual
GLuint
getTextureId
()
=
0
;
};
typedef
::
boost
::
shared_ptr
<
IBufferContext
>
IBufferContextSharedPtr
;
...
...
canvas/source/opengl/ogl_canvascustomsprite.cxx
Dosyayı görüntüle @
396fa3b6
...
...
@@ -159,9 +159,8 @@ namespace oglcanvas
// composite that to screen
// TODO(P3): buffer texture
// TODO: moggi: reimplement as FBO with rendering to texture
pBufferContext
=
NULL
;
// pBufferContext->startBufferRendering();
pBufferContext
=
maCanvasHelper
.
getDeviceHelper
()
->
createBufferContext
(
aSpriteSizePixel
);
pBufferContext
->
startBufferRendering
();
}
// this ends up in pBufferContext, if that one's "current"
...
...
@@ -174,6 +173,8 @@ namespace oglcanvas
// screen now. Calls below switches us back to window
// context, and binds to generated, dynamic texture
pBufferContext
->
endBufferRendering
();
GLuint
nTexture
=
pBufferContext
->
getTextureId
();
glBindTexture
(
GL_TEXTURE_2D
,
nTexture
);
glEnable
(
GL_TEXTURE_2D
);
glTexParameteri
(
GL_TEXTURE_2D
,
...
...
canvas/source/opengl/ogl_spritedevicehelper.cxx
Dosyayı görüntüle @
396fa3b6
...
...
@@ -537,21 +537,29 @@ namespace oglcanvas
namespace
{
/*
* TODO: mogg: reimplement through FBO with texture as backend
class
BufferContextImpl
:
public
IBufferContext
{
::
basegfx
::
B2IVector
maSize
;
const
SpriteDeviceHelper
&
mrDeviceHelper
;
GLuint
mnFrambufferId
;
GLuint
mnDepthId
;
GLuint
mnTextureId
;
virtual
bool
startBufferRendering
()
SAL_OVERRIDE
{
return false;
glBindFramebuffer
(
GL_FRAMEBUFFER
,
mnFrambufferId
);
return
true
;
}
virtual
bool
endBufferRendering
()
SAL_OVERRIDE
{
return false;
glBindFramebuffer
(
GL_FRAMEBUFFER
,
0
);
return
true
;
}
virtual
GLuint
getTextureId
()
SAL_OVERRIDE
{
return
mnTextureId
;
}
public
:
...
...
@@ -559,20 +567,26 @@ namespace oglcanvas
const
::
basegfx
::
B2IVector
&
rSize
)
:
maSize
(
rSize
),
mrDeviceHelper
(
rDeviceHelper
),
mnTexture(0)
mnFrambufferId
(
0
),
mnDepthId
(
0
),
mnTextureId
(
0
)
{
OpenGLHelper
::
createFramebuffer
(
maSize
.
getX
(),
maSize
.
getY
(),
mnFrambufferId
,
mnDepthId
,
mnTextureId
,
false
);
}
virtual
~
BufferContextImpl
()
{
glDeleteTextures
(
1
,
&
mnTextureId
);
glDeleteRenderbuffers
(
1
,
&
mnDepthId
);
glDeleteFramebuffers
(
1
,
&
mnFrambufferId
);
}
};
*/
}
IBufferContextSharedPtr
SpriteDeviceHelper
::
createBufferContext
(
const
::
basegfx
::
B2IVector
&
)
const
IBufferContextSharedPtr
SpriteDeviceHelper
::
createBufferContext
(
const
::
basegfx
::
B2IVector
&
rSize
)
const
{
return
NULL
;
return
IBufferContextSharedPtr
(
new
BufferContextImpl
(
*
this
,
rSize
))
;
}
TextureCache
&
SpriteDeviceHelper
::
getTextureCache
()
const
...
...
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