From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: macOS metal rendering engine in mac port Date: Tue, 21 Sep 2021 19:48:50 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26362"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Illia Ostapyshyn , aaronjensen@gmail.com, emacs-devel@gnu.org To: "Y. E." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 20:50:41 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSkqm-0006dH-AZ for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 20:50:40 +0200 Original-Received: from localhost ([::1]:33712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSkqk-0005jf-Ax for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 14:50:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSkpC-0004KV-FR for emacs-devel@gnu.org; Tue, 21 Sep 2021 14:49:02 -0400 Original-Received: from outbound.soverin.net ([2a01:4f8:fff0:65::8:228]:43567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSkpA-0001GU-7X for emacs-devel@gnu.org; Tue, 21 Sep 2021 14:49:01 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 2166F187; Tue, 21 Sep 2021 18:48:55 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1632250134; bh=3CmHpWDlju2xsNfesFSnegRbOm5+Z7oeoWlMWedbOy0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S1yqa0sAljYQu3oWqiWlGPKYLLDAqCOah/6uiqRBVjjYO7V/aJYvQEe++lB0zdDbs ntHhADX5R/Hj2IuSFPdGxrzPNI5ai8iMcmMvA87S9l/aGsQ8gOfU6Kpy5w5EcLVf5n 4cMLseBFwfR6E47O7y6JQOwVeSccr4WM2jvrPM8yuIp7945idzGI9yxq6PDQvG3kG7 pFBCamDNcCFkjMoqxS4neulfoZsFDgid9nWHpyyjBv1M5CXv4dZjviCTH9fgxR2Hbo EC4ptZzf7TUABd6bCQ8MaKPk1pCP20oo5fQBzCR2rhL9pLQJS9pBXNiZdxr7WaxwYy eVcKVWRI4sSoA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1mSkp0-0004DE-Or; Tue, 21 Sep 2021 19:48:50 +0100 Mail-Followup-To: Alan Third , "Y. E." , Illia Ostapyshyn , aaronjensen@gmail.com, emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2a01:4f8:fff0:65::8:228; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275260 Archived-At: On Tue, Sep 21, 2021 at 10:22:38AM +0300, Y. E. wrote: > > > I just had this happen to me as well, screenshots attached. > > I confirm these screenshots correspond exactly to the issue I saw. > [I had no new cases so far.] Both of these look rather like copyRect is playing up but I can't see what's wrong with it. There are only two callers of copyRect and I can't see anything wrong with them either (and if it was THEIR callers playing up we'd see similar problems outside of the NS port). Aaron's actually looks like it could be copying FAR larger areas than it's supposed to be (for example, wrapping off the right of the screen and back on the left). Illia's looks just like what happens when scrolling goes wrong. Bits of lines end up on the wrong lines and then they get repeated as Emacs copies bits of the frame around. Maybe we just need to do something like this: modified src/nsterm.m @@ -7882,6 +7882,7 @@ - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect #ifdef NS_IMPL_COCOA if ([self wantsLayer]) { + ns_focus (emacsframe, nil, 0); double scale = [[self window] backingScaleFactor]; CGContextRef context = [[NSGraphicsContext currentContext] CGContext]; int bpp = CGBitmapContextGetBitsPerPixel (context) / 8; @@ -7906,7 +7907,7 @@ - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect memmove ((char *) dstPixels + y * rowSize, (char *) srcPixels + y * rowSize, srcRowSize); - + ns_unfocus (emacsframe); } #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 else It seems unlikely, though... -- Alan Third