From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: png images in tool-bar / alpha mask Date: Thu, 3 Apr 2008 23:42:46 +0100 Message-ID: References: <6C1A0020-7B4B-4202-8757-B818A066D40A@gmail.com> <75A94D20-9656-4AD6-9A00-6C0EB26B2335@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207262647 2357 80.91.229.12 (3 Apr 2008 22:44:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2008 22:44:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 04 00:44:39 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JhYAa-0004qn-PD for ged-emacs-devel@m.gmane.org; Fri, 04 Apr 2008 00:44:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhY9y-0000ck-95 for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2008 18:43:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JhY8z-0008Nr-CS for emacs-devel@gnu.org; Thu, 03 Apr 2008 18:42:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JhY8y-0008La-59 for emacs-devel@gnu.org; Thu, 03 Apr 2008 18:42:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhY8x-0008LI-TN for emacs-devel@gnu.org; Thu, 03 Apr 2008 18:42:51 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JhY8x-0006aB-Cl for emacs-devel@gnu.org; Thu, 03 Apr 2008 18:42:51 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 26so4508041fkx.10 for ; Thu, 03 Apr 2008 15:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=4B3wEZj8Agl4BlBTI/IiZ/nnEFfMflcEI6ycdW9R424=; b=g6nbSwM/SwXT0i/t+Ai7/i/62TdN2e0D2mStmvQZJbFAxrjoR/2t/VlX+6d96MeZfmxD3qqnEhYzCD8+Vbp85qqTBj9Hs29PpAGHNNjo3P+u6tYFy6DX5+15kqJ9lcc2zxfykzPuFLFznnbxRr+OviM3GX/IgRJhhuS6aROx+dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=M92JU/inUomHUYeoJ1T51rb9IvJL9+4l8jtyJZTwv6o2gYCIJZ8FG0WAttv0dTCkircVIX0HtSWQRieeen/mRLuZIMobUbJnQaZ3yj+/MZO+FieHO2fzzt6378qx02hbmOpyqZDIDE3qVpj+SUFHoHl4vV8mfObWh5q5//f8/04= Original-Received: by 10.78.118.5 with SMTP id q5mr1306598huc.62.1207262570187; Thu, 03 Apr 2008 15:42:50 -0700 (PDT) Original-Received: from scarlett.lan ( [89.242.130.219]) by mx.google.com with ESMTPS id d2sm6730153nfc.11.2008.04.03.15.42.48 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Apr 2008 15:42:49 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.919.2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94294 Archived-At: On 3 Apr 2008, at 22:55, YAMAMOTO Mitsuharu wrote: > > prepare_image_for_display is never called before all the > postprocessing for the image is completed. OK, so postprocessing seems to be the only processing that can be done to an image. Index: image.c =================================================================== RCS file: /sources/emacs/emacs/src/image.c,v retrieving revision 1.65.2.13 diff -c -r1.65.2.13 image.c *** image.c 28 Mar 2008 14:57:32 -0000 1.65.2.13 --- image.c 3 Apr 2008 22:38:10 -0000 *************** *** 1549,1555 **** } #if defined (MAC_OS) && USE_CG_DRAWING ! if (img->data.ptr_val) { CGImageRelease (img->data.ptr_val); img->data.ptr_val = NULL; --- 1549,1555 ---- } #if defined (MAC_OS) && USE_CG_DRAWING ! if (img->data.ptr_val != NULL) { CGImageRelease (img->data.ptr_val); img->data.ptr_val = NULL; *************** *** 1850,1861 **** mask = image_spec_value (spec, QCheuristic_mask, NULL); if (!NILP (mask)) ! x_build_heuristic_mask (f, img, mask); else { int found_p; mask = image_spec_value (spec, QCmask, &found_p); if (EQ (mask, Qheuristic)) x_build_heuristic_mask (f, img, Qt); --- 1850,1877 ---- mask = image_spec_value (spec, QCheuristic_mask, NULL); if (!NILP (mask)) ! { ! #if defined (MAC_OS) && USE_CG_DRAWING ! if (img->data.ptr_val != NULL) ! { ! CGImageRelease (img->data.ptr_val); ! img->data.ptr_val = NULL; ! } ! #endif ! x_build_heuristic_mask (f, img, mask); ! } else { int found_p; mask = image_spec_value (spec, QCmask, &found_p); + #if defined (MAC_OS) && USE_CG_DRAWING + if (!NILP(mask) && img->data.ptr_val != NULL) + { + CGImageRelease (img->data.ptr_val); + img->data.ptr_val = NULL; + } + #endif if (EQ (mask, Qheuristic)) x_build_heuristic_mask (f, img, Qt); *************** *** 2756,2761 **** --- 2772,2782 ---- UNGCPRO; return 0; } + + #ifdef USE_CG_DRAWING + img->data.ptr_val = image; /* retain original data */ + #endif + rectangle = CGRectMake (0, 0, width, height); QDBeginCGContext (ximg, &context); if (png_p) *************** *** 2767,2773 **** } CGContextDrawImage (context, rectangle, image); QDEndCGContext (ximg, &context); - CGImageRelease (image); /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) --- 2788,2793 ----