summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXImage.c13
-rw-r--r--win/gitmanifest.in1
-rw-r--r--win/svnmanifest.in1
3 files changed, 6 insertions, 9 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index f256d7a..9a1ea45 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -647,14 +647,9 @@ CreateCGImageFromDrawableRect(
{
MacDrawable *mac_drawable = (MacDrawable *)drawable;
CGContextRef cg_context = NULL;
- CGRect image_rect = CGRectMake(x, y, width, height);
CGImageRef cg_image = NULL, result = NULL;
- unsigned char *imageData = NULL;
if (mac_drawable->flags & TK_IS_PIXMAP) {
cg_context = TkMacOSXGetCGContextForDrawable(drawable);
- if (cg_context) {
- cg_image = CGBitmapContextCreateImage((CGContextRef) cg_context);
- }
} else {
NSView *view = TkMacOSXGetNSViewForDrawable(mac_drawable);
if (view == nil) {
@@ -666,9 +661,8 @@ CreateCGImageFromDrawableRect(
NSUInteger bytesPerPixel = 4,
bytesPerRow = bytesPerPixel * view_width,
bitsPerComponent = 8;
- imageData = ckalloc(view_height * bytesPerRow);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- cg_context = CGBitmapContextCreate(imageData, view_width, view_height,
+ cg_context = CGBitmapContextCreate(NULL, view_width, view_height,
bitsPerComponent, bytesPerRow, colorSpace,
kCGImageAlphaPremultipliedLast |
kCGBitmapByteOrder32Big);
@@ -680,10 +674,11 @@ CreateCGImageFromDrawableRect(
CGContextRelease(cg_context);
}
if (cg_image) {
- result = CGImageCreateWithImageInRect(cg_image, image_rect);
+ CGRect rect = CGRectMake(x + mac_drawable->xOff, y + mac_drawable->yOff,
+ width, height);
+ result = CGImageCreateWithImageInRect(cg_image, rect);
CGImageRelease(cg_image);
}
- ckfree(imageData);
return result;
}
diff --git a/win/gitmanifest.in b/win/gitmanifest.in
new file mode 100644
index 0000000..3e7de84
--- /dev/null
+++ b/win/gitmanifest.in
@@ -0,0 +1 @@
+git- \ No newline at end of file
diff --git a/win/svnmanifest.in b/win/svnmanifest.in
new file mode 100644
index 0000000..18d2cad
--- /dev/null
+++ b/win/svnmanifest.in
@@ -0,0 +1 @@
+svn-r \ No newline at end of file