Commit Graph

243 Commits

Author SHA1 Message Date
Tomaž Vajngerl
a1385d37e9 opengl: adjust rect drawing - should be to width (height) - 1
Might be the cause of Rectangle implementation of GetWidth and
GetHeight which is different to other programs.

X11 backend compensates in the same way for this use case.

Change-Id: Ibc3c1d6f442d616c64b602cccb601bfc33fd4baf
2015-07-09 10:09:17 +09:00
Tomaž Vajngerl
bbb8c66ed9 opengl: don't forget to call swapBuffers when paint ends
Change-Id: I05a2dc1c36d5f23ee43bb799f28fc2403743a4c1
2015-07-09 10:09:16 +09:00
Noel Grandin
449d272daf loplugin:unusedmethods vcl
Change-Id: I98b88ca3369a2c888fd63796e39d42376d513002
2015-07-08 09:51:27 +02:00
Tomaž Vajngerl
149e62670e opengl: draw rectangle lines with only one glDrawArrays call
Change-Id: I33e065fe6c084d0bed04ee99c447004fe573278a
2015-07-03 14:52:28 +09:00
Tomaž Vajngerl
33d32a7894 opengl: use common macro for conversion of coordinates
add macro OPENGL_COORD_X and OPENGL_COORD_Y to convert (normalize)
to opengl coordinates that need to be in between -1.0f, 1.0f.

Change-Id: Ide5c53e80fd9140d32883d44e6112b83a01fd111
2015-07-03 14:52:28 +09:00
Tomaž Vajngerl
240e5daab4 opengl: fix fat hairlines - draw hairlines using DrawLineAA
Change-Id: I935bef48fd057e6223dcfc437cbaf2888842fd61
2015-07-03 14:52:27 +09:00
Jan Holesovsky
8daa8ba3ae opengl: More checking for GL errors.
Change-Id: I3bd9b63f7dbfdc5b93202e57385f6136d667878b
2015-03-20 14:10:03 +01:00
Jan Holesovsky
f3c0085d96 opengl: Off-by-one in getPixel.
Change-Id: I971d94c353adcdf70e0f251d6103b1e19042687c
2015-03-19 18:11:57 +01:00
Caolán McNamara
09f4a21d1b this drawAlphaBitmap variant is unused
Change-Id: Id2f9073969babe7ad5984f87949ed870f9d5a8f7
2015-03-05 14:05:09 +00:00
Caolán McNamara
fed1ed0a17 coverity#1267670 Division or modulo by float zero
and

coverity#1267699 Division or modulo by float zero

Change-Id: If31037712208673438155b30369ebe1068387cba
2015-01-31 19:06:55 +00:00
Luboš Luňák
c44ee2beb3 when drawing a transformed bitmap in opengl backend, scale it better
The plain scaling is rather rough, and in fact drawing a scaled bitmap
the normal way gives much better results (because OutputDevice pre-scales
the bitmap before it's drawn). This one may be a bit slow perhaps,
but hopefully nobody there's no code that'd extensively use bitmap
drawing with custom transformations (wishful thinking).

Change-Id: I83e05307adfaeac0ed0757f1a0b2603f64caf8f8
2015-01-27 18:42:48 +01:00
Luboš Luňák
df290c6345 make it possible to easily have variants of glsl programs
Now it's possible to add a preamble to the compiled program, so there can
be just one program with #ifdef's inside and the small variants can be
selected using #define in the preamble instead of having several almost
identical programs.

Change-Id: I6c5112313b91b6269ebdecdfc896e0f96209ea2b
2015-01-27 18:42:48 +01:00
Markus Mohrhard
145ad19643 some debug code for finding leaked OpenGLContexts
Change-Id: I10e8c344ae6aa2e0a4ef562154f57e2070c70e2f
2015-01-20 12:03:57 +01:00
Chris Sherlock
6cc84edfaf Revert "vcl: increment ref in OpenGLSalGraphicsImpl::AcquireContext"
This reverts commit 3d58099064.

Change-Id: Ib16fea0df909d41b2d51d5f3efe44dd4b3419352
Reviewed-on: https://gerrit.libreoffice.org/14033
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-01-20 10:52:34 +00:00
Chris Sherlock
3d58099064 vcl: increment ref in OpenGLSalGraphicsImpl::AcquireContext
Change-Id: Id8167dfe55eb6f7a83454f5eb7a3b5a96e252980
2015-01-20 21:49:50 +11:00
Luboš Luňák
fb907e83ee draw polypolygon outline properly (if wanted)
Again, polygons can apparently have curved edges.

Change-Id: I6519da7bb7f0dde7f1550fe6b03c09be127f77d6
2015-01-19 22:48:13 +01:00
Luboš Luňák
bd976c2764 do not draw with SALCOLOR_NONE
Change-Id: I882a42f58ac298d333985068b2fe6ef9ac198c8b
2015-01-19 22:48:11 +01:00
Luboš Luňák
168315e3b7 remove needless loop
Change-Id: Iaec5aa5bd353c888a3b35a277a3618c29d9cbd67
2015-01-19 22:48:09 +01:00
Luboš Luňák
e437b13008 try to handle properly fillcolor != linecolor in opengl polypolygons drawing
Change-Id: I962416f48fdb348d8a3d95edf747cfe2f1c929c9
2015-01-19 12:17:52 +01:00
Luboš Luňák
90630adcc1 draw polypolygons properly in opengl backend
The polygons that make the polypolygon cannot be simply drawn one onto another,
because if they overlap, it's actually xor (as used e.g. for drawing the border
when editing a text box Impress, which without this fix just made it a full
rectangle instead of a frame).

Change-Id: I67c7f6448fb3ee0f9742a2299c612515abff68d8
2015-01-19 12:17:52 +01:00
Luboš Luňák
b8b37e6ef2 fix opengl hairline special casing
Apparently polygons can consist of curves too.

Change-Id: Ie35861e6d182e4bd4ac0523e78a90618c96f09a6
2015-01-19 12:17:52 +01:00
Luboš Luňák
1f978c136e use AA for convex polygons when needed too
Change-Id: I8e66d369956a9bcf9c63c6eccad47d4b7a7eb67d
2015-01-19 12:17:52 +01:00
Caolán McNamara
674436511d coverity#1264396 Uninitialized scalar field
Change-Id: I085f2d0e15c88b995bea3f99945c9ab2e2bcc909
2015-01-15 20:18:02 +00:00
Caolán McNamara
9de63f23c7 WaE: vcl/opengl/gdiimpl.cxx
Change-Id: Ibd5c8574b0454f9f3688a65d246fd2dea4d0dda8
2015-01-12 20:22:17 +00:00
Luboš Luňák
e126f5cb09 implement optimized hairline drawing for opengl
As a side effect, this prevents the lines from looking too wide,
because of generic polygon drawing being a bit too generous with AA.

Change-Id: I17314c39fd57e33ecbd10b8a8785c600bdc5b212
2015-01-12 13:34:38 +01:00
Luboš Luňák
ca1f918c32 make AA edges of objects look smoother (opengl)
Change-Id: I66a04febdbfa673e0883ab6f574bb7768cad7953
2015-01-12 13:34:14 +01:00
Luboš Luňák
67d6aef4c5 clean up resetting of solid color when using opengl AA
118529d4644a and 011903894 might have been technically correct, but
'mProgramIsSolidLineColor' is clearly a misnomer at best, and they'd
have made it even more likely that this would break yet again.

Change-Id: I1f01663e2abc0b1b0e557ae7241637a96e1a402a
2015-01-12 13:31:49 +01:00
Luboš Luňák
b8b49af63e fix confusion between transparency and opacity
Change-Id: Ifa69f3272ebda2a61ac00d2affb8aebd4524f0fc
2015-01-12 13:31:47 +01:00
Markus Mohrhard
1ddb7c2c9d it makes no sense to use the line color in some cases
Hopefully that helps a little bit with some strange rendering effects.

Change-Id: I6b001bf31d745d6d19f91acadee5ceb0e5480025
2015-01-07 08:54:47 +01:00
Markus Mohrhard
3a74b40f0f make sure to use the FillColor when we used it before
Change-Id: I36443d12e1607221b9505d1e05a51e804d714e16
2015-01-07 08:54:46 +01:00
Markus Mohrhard
5c60dab390 add some warnings to non-implemented features
Change-Id: Icbd1a46dc426a0527422d55f77e67eac755bbc8b
2014-12-31 01:04:31 +01:00
Luboš Luňák
783ba49aa0 draw also opengl polygon with AA edges if AA is wanted
Especially given that lines are sometimes actually drawn using polygons.

Change-Id: I429a24faff94f8b9accc20bdee3ff66f47669bde
2014-12-18 12:05:36 +01:00
Luboš Luňák
5e7709c5e9 use AA for lines only when AA is active
Change-Id: I9965f58b8f06f1cec2c419dcf16d8aebf9cd97b8
2014-12-15 22:15:01 +01:00
Caolán McNamara
580e211541 -Werror=unused-but-set-variable
Change-Id: Ia65754272ff5c1661241dd503cef23c7a89b660e
2014-12-15 12:55:49 +00:00
Luboš Luňák
f8520e2999 draw lines anti-aliased (opengl vcl)
Change-Id: I3a67da89cedbb6a58b2556abf4553857125af5a6
2014-12-15 13:05:35 +01:00
Luboš Luňák
cbc57a99c2 allow using more than one opengl program during one draw "operation"
I.e. between one PreDraw()/PostDraw() pair.

Change-Id: I358d603ff33fa7416a4033bf074fe390b1112fcc
2014-12-15 13:05:17 +01:00
Michael Meeks
b7d74366a9 vcldemo: disable broken gradient stencil use.
Change-Id: Ifce85b1a7fa8e8b6fc57802a5fb559d2db50ba2a
2014-12-11 14:09:12 +01:00
Louis-Francis Ratté-Boulianne
01bed8089a vcl: Re-use a framebuffer of the same size when possible
Conflicts:
	include/vcl/opengl/OpenGLContext.hxx

Change-Id: Id9c7932976ce9d9282776c20d93d9cca4d290056
2014-12-11 07:57:33 +01:00
Louis-Francis Ratté-Boulianne
4c424d7852 vcl: Keep the same context for VirtualDevice to avoid FBO switches
Change-Id: I66496fae902db9df5b8301b00bb779f42adaa7a7
2014-12-11 07:57:32 +01:00
Louis-Francis Ratté-Boulianne
f0f5f50243 vcl: Limit Cairo surface size to the clipping region to improve performance
Conflicts:
	vcl/unx/generic/gdi/openglx11cairotextrender.cxx

Change-Id: I469b34c9f1047a274550229391d3dfb578291df6
2014-12-11 07:57:30 +01:00
Louis-Francis Ratté-Boulianne
53193345e0 vcl: Release the OpenGL context for offscreen rendering after each operation
Change-Id: If253a4c0a1f64b1cc54e0079d4455abf39620ac0
2014-12-03 14:05:34 +01:00
Louis-Francis Ratté-Boulianne
0a04ceca6c vcl: Don't create new contexts for Virtual Devices on Windows
Change-Id: I561a8142f986aca89e796ce2c4a0902fae41f9e6
2014-12-03 14:05:34 +01:00
Markus Mohrhard
8091457a23 Revert "use boost::shared_ptr instead of manual ref counting"
This reverts commit 8eeb02dcc1.

Conflicts:
	include/vcl/opengl/OpenGLContext.hxx
	vcl/inc/openglgdiimpl.hxx
	vcl/opengl/gdiimpl.cxx

Change-Id: I85cc7a46876ffba5ab861f6dd83b07da466b212b
2014-12-02 21:52:14 +01:00
Michael Meeks
aefeef36fd vcl: use resetToReInitialize to avoid context problems on Windows.
It appears that we have to do this for VirtualDevices, where we have
freed / re-allocated the underlying resource, or we fail to switch the
current context, and render to the wrong place, before blatting a
blank texture over the top of it.

Change-Id: I0253f216ea7dc9786374dc83ca38f4f6295e3035
2014-12-02 11:58:47 +01:00
Louis-Francis Ratté-Boulianne
f1bfdc153b vcl: Fix a coordinate issue when getting a bitmap from a VirtualDevice
Change-Id: I06fef2765f2dc9d64a991385a984a4c75a1fd424
2014-12-02 11:58:46 +01:00
Louis-Francis Ratté-Boulianne
99ade27b04 vcl: Only load OpenGL shaders once for each context
Change-Id: Idbf9026c5e64ef41d4c913153dfddf36923ff7de
2014-12-02 11:58:45 +01:00
Michael Meeks
5dcaefdae5 vcl: Consolidate size information around the GeometryProvider.
Conflicts:
	vcl/inc/openglgdiimpl.hxx

Change-Id: I1d764a8dba1850d2475f08e1014a085846f336c3
2014-12-02 08:34:52 +01:00
Louis-Francis Ratté-Boulianne
d6b51a87b4 vcl: Use the current OpenGL context for VirtualDevice and Bitmap if possible
Conflicts:
	include/vcl/opengl/OpenGLContext.hxx
	vcl/inc/openglgdiimpl.hxx
	vcl/opengl/gdiimpl.cxx
	vcl/opengl/x11/gdiimpl.cxx
	vcl/source/opengl/OpenGLContext.cxx

Change-Id: I17f6ce66fb8b5bc027d35b4016ae56c24ee0a738
2014-12-02 08:34:51 +01:00
Tor Lillqvist
ea25c799ea WaE: implicit conversion of NULL constant to 'boost::detail::sp_nullptr_t'
Change-Id: I71923bdeb7b66662f114b3e72d9e3846f8b9ff92
2014-12-01 10:06:23 +02:00
Markus Mohrhard
8eeb02dcc1 use boost::shared_ptr instead of manual ref counting
Change-Id: I3c2ed9b5641202ff965c3a0c833c8201b2b1548b
2014-12-01 07:37:06 +01:00