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
8bc28541
Kaydet (Commit)
8bc28541
authored
Mar 31, 2014
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More CoreGraphics tracing
Change-Id: I2fbdb95637ee77b444e1947405d64cdd2e0338af
üst
6f86b9d0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
salbmp.cxx
vcl/quartz/salbmp.cxx
+19
-0
salgdicommon.cxx
vcl/quartz/salgdicommon.cxx
+1
-0
salvd.cxx
vcl/quartz/salvd.cxx
+9
-2
No files found.
vcl/quartz/salbmp.cxx
Dosyayı görüntüle @
8bc28541
...
...
@@ -29,6 +29,7 @@
#include "vcl/salbtype.hxx"
#include "quartz/salbmp.h"
#include "quartz/utils.h"
#ifdef MACOSX
#include "osx/saldata.hxx"
...
...
@@ -103,7 +104,10 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
// copy layer content into the bitmap buffer
const
CGPoint
aSrcPoint
=
{
static_cast
<
CGFloat
>
(
-
nX
),
static_cast
<
CGFloat
>
(
-
nY
)
};
if
(
mxGraphicContext
)
// remove warning
{
CG_TRACE
(
"CGContextDrawLayerAtPoint("
<<
mxGraphicContext
<<
","
<<
aSrcPoint
<<
","
<<
xLayer
<<
")"
);
CGContextDrawLayerAtPoint
(
mxGraphicContext
,
aSrcPoint
,
xLayer
);
}
return
true
;
}
...
...
@@ -173,11 +177,16 @@ void QuartzSalBitmap::Destroy()
void
QuartzSalBitmap
::
DestroyContext
()
{
if
(
mxCachedImage
)
{
CG_TRACE
(
"CGImageRelease("
<<
mxCachedImage
<<
")"
);
CGImageRelease
(
mxCachedImage
);
mxCachedImage
=
NULL
;
}
if
(
mxGraphicContext
)
{
CG_TRACE
(
"CGContextRelease("
<<
mxGraphicContext
<<
")"
);
CGContextRelease
(
mxGraphicContext
);
mxGraphicContext
=
NULL
;
maContextBuffer
.
reset
();
...
...
@@ -739,6 +748,7 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
return
NULL
;
mxCachedImage
=
CGBitmapContextCreateImage
(
mxGraphicContext
);
CG_TRACE
(
"CGBitmapContextCreateImage("
<<
mxGraphicContext
<<
") = "
<<
mxCachedImage
);
}
CGImageRef
xCroppedImage
=
NULL
;
...
...
@@ -753,6 +763,7 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
nY
=
mnHeight
-
(
nY
+
nNewHeight
);
// adjust for y-mirrored context
const
CGRect
aCropRect
=
{
{
static_cast
<
CGFloat
>
(
nX
),
static_cast
<
CGFloat
>
(
nY
)
},
{
static_cast
<
CGFloat
>
(
nNewWidth
),
static_cast
<
CGFloat
>
(
nNewHeight
)
}
};
xCroppedImage
=
CGImageCreateWithImageInRect
(
mxCachedImage
,
aCropRect
);
CG_TRACE
(
"CGImageCreateWithImageInRect("
<<
mxCachedImage
<<
","
<<
aCropRect
<<
") = "
<<
xCroppedImage
);
}
return
xCroppedImage
;
...
...
@@ -788,13 +799,18 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
void
*
pMaskMem
=
rtl_allocateMemory
(
nMaskBytesPerRow
*
nHeight
);
CGContextRef
xMaskContext
=
CGBitmapContextCreate
(
pMaskMem
,
nWidth
,
nHeight
,
8
,
nMaskBytesPerRow
,
GetSalData
()
->
mxGraySpace
,
kCGImageAlphaNone
);
CG_TRACE
(
"CGBitmapContextCreate("
<<
nWidth
<<
"x"
<<
nHeight
<<
"x8) = "
<<
xMaskContext
);
CG_TRACE
(
"CGContextDrawImage("
<<
xMaskContext
<<
","
<<
xImageRect
<<
","
<<
xMask
<<
")"
);
CGContextDrawImage
(
xMaskContext
,
xImageRect
,
xMask
);
CG_TRACE
(
"CFRelease("
<<
xMask
<<
")"
);
CFRelease
(
xMask
);
CGDataProviderRef
xDataProvider
(
CGDataProviderCreateWithData
(
NULL
,
pMaskMem
,
nHeight
*
nMaskBytesPerRow
,
&
CFRTLFree
)
);
static
const
CGFloat
*
pDecode
=
NULL
;
xMask
=
CGImageMaskCreate
(
nWidth
,
nHeight
,
8
,
8
,
nMaskBytesPerRow
,
xDataProvider
,
pDecode
,
false
);
CG_TRACE
(
"CGImageMaskCreate("
<<
nWidth
<<
","
<<
nHeight
<<
",8,8) = "
<<
xMask
);
CFRelease
(
xDataProvider
);
CG_TRACE
(
"CFRelease("
<<
xMaskContext
<<
")"
);
CFRelease
(
xMaskContext
);
}
...
...
@@ -803,7 +819,10 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
// combine image and alpha mask
CGImageRef
xMaskedImage
=
CGImageCreateWithMask
(
xImage
,
xMask
);
CG_TRACE
(
"CGImageCreateWithMask("
<<
xImage
<<
","
<<
xMask
<<
") = "
<<
xMaskedImage
);
CG_TRACE
(
"CFRelease("
<<
xMask
<<
")"
);
CFRelease
(
xMask
);
CG_TRACE
(
"CFRelease("
<<
xImage
<<
")"
);
CFRelease
(
xImage
);
return
xMaskedImage
;
}
...
...
vcl/quartz/salgdicommon.cxx
Dosyayı görüntüle @
8bc28541
...
...
@@ -484,6 +484,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
xSrcLayer
=
CGLayerCreateWithContext
(
xCopyContext
,
aSrcSize
,
NULL
);
CG_TRACE
(
"CGLayerCreateWithContext("
<<
xCopyContext
<<
","
<<
aSrcSize
<<
",NULL) = "
<<
xSrcLayer
);
const
CGContextRef
xSrcContext
=
CGLayerGetContext
(
xSrcLayer
);
CG_TRACE
(
"CGLayerGetContext("
<<
xSrcLayer
<<
") = "
<<
xSrcContext
);
CGPoint
aSrcPoint
=
CGPointMake
(
-
nSrcX
,
-
nSrcY
);
if
(
IsFlipped
()
)
{
...
...
vcl/quartz/salvd.cxx
Dosyayı görüntüle @
8bc28541
...
...
@@ -32,8 +32,7 @@
#include "headless/svpvd.hxx"
#endif
#include "quartz/salgdi.h"
#include "quartz/utils.h"
SalVirtualDevice
*
AquaSalInstance
::
CreateVirtualDevice
(
SalGraphics
*
pGraphics
,
long
nDX
,
long
nDY
,
sal_uInt16
nBitCount
,
const
SystemGraphicsData
*
pData
)
...
...
@@ -74,6 +73,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX,
if
(
nDY
==
0
)
nDY
=
1
;
mxLayer
=
CGLayerCreateWithContext
(
pData
->
rCGContext
,
CGSizeMake
(
nDX
,
nDY
),
NULL
);
CG_TRACE
(
"CGLayerCreateWithContext("
<<
pData
->
rCGContext
<<
","
<<
CGSizeMake
(
nDX
,
nDY
)
<<
",NULL) = "
<<
mxLayer
);
mpGraphics
->
SetVirDevGraphics
(
mxLayer
,
pData
->
rCGContext
);
}
else
...
...
@@ -131,6 +131,7 @@ void AquaSalVirtualDevice::Destroy()
{
if
(
mpGraphics
)
mpGraphics
->
SetVirDevGraphics
(
NULL
,
NULL
);
CG_TRACE
(
"CGLayerRelease("
<<
mxLayer
<<
")"
);
CGLayerRelease
(
mxLayer
);
mxLayer
=
NULL
;
}
...
...
@@ -139,6 +140,7 @@ void AquaSalVirtualDevice::Destroy()
{
void
*
pRawData
=
CGBitmapContextGetData
(
mxBitmapContext
);
rtl_freeMemory
(
pRawData
);
CG_TRACE
(
"CGContextRelease("
<<
mxBitmapContext
<<
")"
);
CGContextRelease
(
mxBitmapContext
);
mxBitmapContext
=
NULL
;
}
...
...
@@ -198,6 +200,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
void
*
pRawData
=
rtl_allocateMemory
(
nBytesPerRow
*
nDY
);
mxBitmapContext
=
CGBitmapContextCreate
(
pRawData
,
nDX
,
nDY
,
mnBitmapDepth
,
nBytesPerRow
,
aCGColorSpace
,
aCGBmpInfo
);
CG_TRACE
(
"CGBitmapContextCreate("
<<
nDX
<<
"x"
<<
nDY
<<
"x"
<<
mnBitmapDepth
<<
") = "
<<
mxBitmapContext
);
xCGContext
=
mxBitmapContext
;
}
else
...
...
@@ -254,6 +257,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
void
*
pRawData
=
rtl_allocateMemory
(
nBytesPerRow
*
nDY
);
mxBitmapContext
=
CGBitmapContextCreate
(
pRawData
,
nDX
,
nDY
,
8
,
nBytesPerRow
,
aCGColorSpace
,
aCGBmpInfo
);
CG_TRACE
(
"CGBitmapContextCreate("
<<
nDX
<<
"x"
<<
nDY
<<
"x8) = "
<<
mxBitmapContext
);
xCGContext
=
mxBitmapContext
;
#endif
}
...
...
@@ -262,11 +266,13 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
const
CGSize
aNewSize
=
{
static_cast
<
CGFloat
>
(
nDX
),
static_cast
<
CGFloat
>
(
nDY
)
};
mxLayer
=
CGLayerCreateWithContext
(
xCGContext
,
aNewSize
,
NULL
);
CG_TRACE
(
"CGLayerCreateWithContext("
<<
xCGContext
<<
","
<<
aNewSize
<<
",NULL) = "
<<
mxLayer
);
if
(
mxLayer
&&
mpGraphics
)
{
// get the matching Quartz context
CGContextRef
xDrawContext
=
CGLayerGetContext
(
mxLayer
);
CG_TRACE
(
"CGLayerGetContext("
<<
mxLayer
<<
") = "
<<
xDrawContext
);
mpGraphics
->
SetVirDevGraphics
(
mxLayer
,
xDrawContext
,
mnBitmapDepth
);
}
...
...
@@ -282,6 +288,7 @@ void AquaSalVirtualDevice::GetSize( long& rWidth, long& rHeight )
const
CGSize
aSize
=
CGLayerGetSize
(
mxLayer
);
rWidth
=
static_cast
<
long
>
(
aSize
.
width
);
rHeight
=
static_cast
<
long
>
(
aSize
.
height
);
CG_TRACE
(
"CGLayerGetSize("
<<
mxLayer
<<
") = "
<<
aSize
<<
"("
<<
rWidth
<<
"x"
<<
rHeight
<<
")"
);
}
else
{
...
...
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