Kaydet (Commit) 642b86aa authored tarafından David Tardon's avatar David Tardon

fix 3D 'fade' transitions

* canvas bitmaps created without transparency get an appropriate color
  space
* implement a color space for OpenGL RGBA to use instead of
  canvas::tools::getStdColorSpace(), which apparently uses VCL's
  interpretation of alpha (alpha == 0xff means full transparency,
  alpha == 0 full opacity).

Change-Id: I97f30533206b75132abd0bb0d290a279f15ae8a9
üst e02f6553
......@@ -359,6 +359,14 @@ namespace canvas
*/
CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerBitmapColorSpace> getStdColorSpace();
/** Return a color space for a default RGB integer format
Use this method for dead-simple bitmap implementations,
that map all their formats to 8888 RGB color (the last byte
is unused).
*/
CANVASTOOLS_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerBitmapColorSpace> getStdColorSpaceWithoutAlpha();
/** Return a memory layout for a default RGBA integer format
Use this method for dead-simple bitmap implementations,
......
......@@ -301,6 +301,8 @@ namespace cairocanvas
const ::com::sun::star::rendering::RenderState& renderState,
bool setColor );
com::sun::star::rendering::IntegerBitmapLayout impl_getMemoryLayout( sal_Int32 nWidth, sal_Int32 nHeight );
/// When true, content is able to represent alpha
bool mbHaveAlpha;
......
......@@ -539,7 +539,11 @@ namespace vclcanvas
if( !mpOutDev.get() )
return rendering::IntegerBitmapLayout(); // we're disposed
return ::canvas::tools::getStdMemoryLayout(getSize());
rendering::IntegerBitmapLayout xBitmapLayout( ::canvas::tools::getStdMemoryLayout(getSize()) );
if ( !hasAlpha() )
xBitmapLayout.ColorSpace = canvas::tools::getStdColorSpaceWithoutAlpha();
return xBitmapLayout;
}
BitmapEx CanvasBitmapHelper::getBitmap() const
......
......@@ -1195,7 +1195,11 @@ namespace vclcanvas
if( !mpOutDev.get() )
return rendering::IntegerBitmapLayout(); // we're disposed
return ::canvas::tools::getStdMemoryLayout(getSize());
rendering::IntegerBitmapLayout xBitmapLayout( ::canvas::tools::getStdMemoryLayout(getSize()) );
if ( !mbHaveAlpha )
xBitmapLayout.ColorSpace = canvas::tools::getStdColorSpaceWithoutAlpha();
return xBitmapLayout;
}
int CanvasHelper::setupOutDevState( const rendering::ViewState& viewState,
......
......@@ -194,7 +194,9 @@ namespace vclcanvas
{
uno::Reference<rendering::XColorSpace> operator()()
{
return vcl::unotools::createStandardColorSpace();
uno::Reference< rendering::XColorSpace > xColorSpace( canvas::tools::getStdColorSpace(), uno::UNO_QUERY );
assert( xColorSpace.is() );
return xColorSpace;
}
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment