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
1b0df37e
Kaydet (Commit)
1b0df37e
authored
Eki 31, 2014
tarafından
Louis-Francis Ratté-Boulianne
Kaydeden (comit)
Markus Mohrhard
Kas 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: Add OpenGLSalBitmap implementation
Change-Id: I0deebaedf6fe5b23f50a448eea0d5d9e99ebd391
üst
251f9af7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
15 deletions
+109
-15
Library_vcl.mk
vcl/Library_vcl.mk
+1
-0
salbmp.hxx
vcl/inc/opengl/salbmp.hxx
+90
-0
gdiimpl.cxx
vcl/opengl/gdiimpl.cxx
+11
-14
salbmp.cxx
vcl/opengl/salbmp.cxx
+0
-0
salbmp.cxx
vcl/unx/generic/gdi/salbmp.cxx
+7
-1
No files found.
vcl/Library_vcl.mk
Dosyayı görüntüle @
1b0df37e
...
@@ -123,6 +123,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
...
@@ -123,6 +123,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
$(eval $(call gb_Library_add_exception_objects,vcl,\
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/opengl/gdiimpl \
vcl/opengl/gdiimpl \
vcl/opengl/salbmp \
vcl/source/opengl/OpenGLContext \
vcl/source/opengl/OpenGLContext \
vcl/source/opengl/OpenGLHelper \
vcl/source/opengl/OpenGLHelper \
vcl/source/window/openglwin \
vcl/source/window/openglwin \
...
...
vcl/inc/opengl/salbmp.hxx
0 → 100644
Dosyayı görüntüle @
1b0df37e
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_VCL_INC_OPENGL_SALBMP_H
#define INCLUDED_VCL_INC_OPENGL_SALBMP_H
#include <basebmp/bitmapdevice.hxx>
#include <vcl/opengl/OpenGLContext.hxx>
#include "vcl/salbtype.hxx"
#include <salbmp.hxx>
// - SalBitmap -
struct
BitmapBuffer
;
class
BitmapPalette
;
class
VCL_PLUGIN_PUBLIC
OpenGLSalBitmap
:
public
SalBitmap
{
private
:
OpenGLContext
*
mpContext
;
GLuint
mnTexture
;
bool
mbDirtyTexture
;
BitmapPalette
maPalette
;
basebmp
::
RawMemorySharedArray
maUserBuffer
;
sal_uInt16
mnBits
;
sal_uInt16
mnBytesPerRow
;
int
mnWidth
;
int
mnHeight
;
public
:
OpenGLSalBitmap
();
virtual
~
OpenGLSalBitmap
();
public
:
// SalBitmap methods
bool
Create
(
const
Size
&
rSize
,
sal_uInt16
nBitCount
,
const
BitmapPalette
&
rPal
)
SAL_OVERRIDE
;
bool
Create
(
const
SalBitmap
&
rSalBmp
)
SAL_OVERRIDE
;
bool
Create
(
const
SalBitmap
&
rSalBmp
,
SalGraphics
*
pGraphics
)
SAL_OVERRIDE
;
bool
Create
(
const
SalBitmap
&
rSalBmp
,
sal_uInt16
nNewBitCount
)
SAL_OVERRIDE
;
virtual
bool
Create
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
rendering
::
XBitmapCanvas
>
xBitmapCanvas
,
Size
&
rSize
,
bool
bMask
=
false
)
SAL_OVERRIDE
;
void
Destroy
()
SAL_OVERRIDE
;
Size
GetSize
()
const
SAL_OVERRIDE
;
sal_uInt16
GetBitCount
()
const
SAL_OVERRIDE
;
BitmapBuffer
*
AcquireBuffer
(
bool
bReadOnly
)
SAL_OVERRIDE
;
void
ReleaseBuffer
(
BitmapBuffer
*
pBuffer
,
bool
bReadOnly
)
SAL_OVERRIDE
;
bool
GetSystemData
(
BitmapSystemData
&
rData
)
SAL_OVERRIDE
;
public
:
bool
Create
(
OpenGLContext
&
rContext
,
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
);
bool
Draw
(
OpenGLContext
&
rContext
,
const
SalTwoRect
&
rPosAry
);
GLuint
GetTexture
(
OpenGLContext
&
rContext
)
const
;
private
:
GLuint
CreateTexture
();
void
DeleteTexture
();
void
DrawTexture
(
GLuint
nTexture
,
const
SalTwoRect
&
rPosAry
);
bool
AllocateUserData
();
bool
ReadTexture
();
};
#endif // INCLUDED_VCL_INC_OPENGL_SALBMP_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/opengl/gdiimpl.cxx
Dosyayı görüntüle @
1b0df37e
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
#include "opengl/salbmp.hxx"
#define GL_ATTRIB_POS 0
#define GL_ATTRIB_POS 0
#define GL_ATTRIB_TEX 1
#define GL_ATTRIB_TEX 1
...
@@ -654,8 +655,9 @@ void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* /*
...
@@ -654,8 +655,9 @@ void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* /*
void
OpenGLSalGraphicsImpl
::
drawBitmap
(
const
SalTwoRect
&
rPosAry
,
const
SalBitmap
&
rSalBitmap
)
void
OpenGLSalGraphicsImpl
::
drawBitmap
(
const
SalTwoRect
&
rPosAry
,
const
SalBitmap
&
rSalBitmap
)
{
{
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
GLuint
nTexture
=
rBitmap
.
GetTexture
();
GLuint
nTexture
=
rBitmap
.
GetTexture
(
maContext
);
SAL_INFO
(
"vcl.opengl"
,
"::drawBitmap"
);
maContext
.
makeCurrent
();
maContext
.
makeCurrent
();
DrawTexture
(
nTexture
,
rPosAry
);
DrawTexture
(
nTexture
,
rPosAry
);
}
}
...
@@ -675,9 +677,10 @@ void OpenGLSalGraphicsImpl::drawBitmap(
...
@@ -675,9 +677,10 @@ void OpenGLSalGraphicsImpl::drawBitmap(
{
{
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rMask
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rMaskBitmap
);
const
OpenGLSalBitmap
&
rMask
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rMaskBitmap
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
()
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
(
maContext
)
);
const
GLuint
nMask
(
rMask
.
GetTexture
()
);
const
GLuint
nMask
(
rMask
.
GetTexture
(
maContext
)
);
SAL_INFO
(
"vcl.opengl"
,
"::drawBitmap"
);
maContext
.
makeCurrent
();
maContext
.
makeCurrent
();
DrawTextureWithMask
(
nTexture
,
nMask
,
rPosAry
);
DrawTextureWithMask
(
nTexture
,
nMask
,
rPosAry
);
}
}
...
@@ -688,22 +691,16 @@ void OpenGLSalGraphicsImpl::drawMask(
...
@@ -688,22 +691,16 @@ void OpenGLSalGraphicsImpl::drawMask(
SalColor
nMaskColor
)
SalColor
nMaskColor
)
{
{
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
()
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
(
maContext
)
);
maContext
.
makeCurrent
();
DrawMask
(
nTexture
,
nMaskColor
,
rPosAry
);
DrawMask
(
nTexture
,
nMaskColor
,
rPosAry
);
}
}
SalBitmap
*
OpenGLSalGraphicsImpl
::
getBitmap
(
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
)
SalBitmap
*
OpenGLSalGraphicsImpl
::
getBitmap
(
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
)
{
{
GLuint
nTexture
;
/*glGenTexture( 1, &nTexture );
glBindTexture( GL_TEXTURE_2D, nTexture );
glCopyTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, nX, nY, nWidth, nHeight, 0 );
glBindTexture( GL_TEXTURE_2D, 0 );*/
OpenGLSalBitmap
*
pBitmap
=
new
OpenGLSalBitmap
;
OpenGLSalBitmap
*
pBitmap
=
new
OpenGLSalBitmap
;
if
(
!
pBitmap
->
Create
(
nX
,
nY
,
nWidth
,
nHeight
)
)
if
(
!
pBitmap
->
Create
(
maContext
,
nX
,
nY
,
nWidth
,
nHeight
)
)
{
{
delete
pBitmap
;
delete
pBitmap
;
pBitmap
=
NULL
;
pBitmap
=
NULL
;
...
@@ -796,8 +793,8 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap(
...
@@ -796,8 +793,8 @@ bool OpenGLSalGraphicsImpl::drawAlphaBitmap(
{
{
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rBitmap
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rSalBitmap
);
const
OpenGLSalBitmap
&
rAlpha
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rAlphaBitmap
);
const
OpenGLSalBitmap
&
rAlpha
=
static_cast
<
const
OpenGLSalBitmap
&>
(
rAlphaBitmap
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
()
);
const
GLuint
nTexture
(
rBitmap
.
GetTexture
(
maContext
)
);
const
GLuint
nAlpha
(
rAlpha
.
GetTexture
()
);
const
GLuint
nAlpha
(
rAlpha
.
GetTexture
(
maContext
)
);
maContext
.
makeCurrent
();
maContext
.
makeCurrent
();
DrawTextureWithMask
(
nTexture
,
nAlpha
,
rPosAry
);
DrawTextureWithMask
(
nTexture
,
nAlpha
,
rPosAry
);
...
...
vcl/opengl/salbmp.cxx
0 → 100644
Dosyayı görüntüle @
1b0df37e
This diff is collapsed.
Click to expand it.
vcl/unx/generic/gdi/salbmp.cxx
Dosyayı görüntüle @
1b0df37e
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
#include <unx/salinst.h>
#include <unx/salinst.h>
#include <unx/x11/xlimits.hxx>
#include <unx/x11/xlimits.hxx>
#include <opengl/salbmp.hxx>
#if defined HAVE_VALGRIND_HEADERS
#if defined HAVE_VALGRIND_HEADERS
#include <valgrind/memcheck.h>
#include <valgrind/memcheck.h>
#endif
#endif
...
@@ -53,7 +55,11 @@
...
@@ -53,7 +55,11 @@
SalBitmap
*
X11SalInstance
::
CreateSalBitmap
()
SalBitmap
*
X11SalInstance
::
CreateSalBitmap
()
{
{
return
new
X11SalBitmap
();
static
const
char
*
pOpenGL
=
getenv
(
"USE_OPENGL"
);
if
(
pOpenGL
)
return
new
OpenGLSalBitmap
();
else
return
new
X11SalBitmap
();
}
}
ImplSalBitmapCache
*
X11SalBitmap
::
mpCache
=
NULL
;
ImplSalBitmapCache
*
X11SalBitmap
::
mpCache
=
NULL
;
...
...
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