summaryrefslogtreecommitdiff
path: root/vcl/opengl/salbmp.cxx
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-12-03 17:02:37 -0500
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-11 07:57:27 +0100
commit83861ce123c2d7b1ce9c6acfbc0e457662eac944 (patch)
tree18ca72332f1a6dbd7b601d8829bc4b988ed97235 /vcl/opengl/salbmp.cxx
parent9f839e9b3cbdca1511961a85b40d1c6825e43ba1 (diff)
vcl: Add BitmapInfoAccess for bitmaps' metadata access
Change-Id: Iec9f8c7d8f7cded0aef9e017373e44387dc0b05c
Diffstat (limited to 'vcl/opengl/salbmp.cxx')
-rw-r--r--vcl/opengl/salbmp.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 94c0c870ae76..20ef2c434caf 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -477,21 +477,25 @@ void OpenGLSalBitmap::makeCurrent()
mpContext->makeCurrent();
}
-BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
+BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode )
{
- if( !maUserBuffer.get() )
- {
- if( !AllocateUserData() )
- return NULL;
- if( maTexture && !ReadTexture() )
- return NULL;
- }
- if( !maPendingOps.empty() )
+ if( nMode != BITMAP_INFO_ACCESS )
{
- SAL_INFO( "vcl.opengl", "** Creating texture and reading it back immediatly" );
- if( !CreateTexture() || !AllocateUserData() || !ReadTexture() )
- return NULL;
+ if( !maUserBuffer.get() )
+ {
+ if( !AllocateUserData() )
+ return NULL;
+ if( maTexture && !ReadTexture() )
+ return NULL;
+ }
+
+ if( !maPendingOps.empty() )
+ {
+ SAL_INFO( "vcl.opengl", "** Creating texture and reading it back immediatly" );
+ if( !CreateTexture() || !AllocateUserData() || !ReadTexture() )
+ return NULL;
+ }
}
BitmapBuffer* pBuffer = new BitmapBuffer;
@@ -518,9 +522,9 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
return pBuffer;
}
-void OpenGLSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
+void OpenGLSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode )
{
- if( !bReadOnly )
+ if( nMode == BITMAP_WRITE_ACCESS )
{
maTexture = OpenGLTexture();
mbDirtyTexture = true;