cocoa: create only bitmaps which can be used for context creation

git-svn-id: trunk@38929 -
This commit is contained in:
paul 2012-10-01 01:58:08 +00:00
parent 68ef99b929
commit a2bccb587a
2 changed files with 8 additions and 5 deletions

View File

@ -725,9 +725,10 @@ begin
end;
HasAlpha := AType in [cbtARGB, cbtRGBA];
if HasAlpha then
BitmapFormat := NSAlphaNonpremultipliedBitmapFormat
else
// Non premultiplied bitmaps can't be used for bitmap context
//if HasAlpha then
// BitmapFormat := NSAlphaNonpremultipliedBitmapFormat
//else
BitmapFormat := 0;
if AType in [cbtARGB, cbtRGB] then
BitmapFormat := BitmapFormat or NSAlphaFirstBitmapFormat;
@ -754,7 +755,7 @@ end;
constructor TCocoaBitmap.CreateDefault;
begin
Create(1, 1, 32, 32, cbaDQWord, cbtARGB, nil);
Create(1, 1, 32, 32, cbaByte, cbtARGB, nil);
end;
destructor TCocoaBitmap.Destroy;
@ -2535,6 +2536,9 @@ var
begin
if ADC = nil then Exit;
if ADC.CGContext = nil then
Exit;
if UseROP2 then
AROP2 := ADC.ROP2
else

View File

@ -354,7 +354,6 @@ begin
if not AButton.HandleAllocated then
Exit;
cf := NSStringUtf8(DefEq[ADefault]);
NSButton(AButton.Handle).setKeyEquivalent(cf);
cf.release;
end;