From commits-return-13662-apmail-sis-commits-archive=sis.apache.org@sis.apache.org Wed Jun 17 17:39:27 2020 Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 3600419A04 for ; Wed, 17 Jun 2020 17:39:27 +0000 (UTC) Received: (qmail 66373 invoked by uid 500); 17 Jun 2020 17:39:26 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 66358 invoked by uid 500); 17 Jun 2020 17:39:26 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 66287 invoked by uid 99); 17 Jun 2020 17:39:26 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2020 17:39:26 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id E0883890B2; Wed, 17 Jun 2020 17:39:25 +0000 (UTC) Date: Wed, 17 Jun 2020 17:39:28 +0000 To: "commits@sis.apache.org" Subject: [sis] 03/03: Fix image transparency. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: desruisseaux@apache.org In-Reply-To: <159241556577.12371.3906301590138493354@gitbox.apache.org> References: <159241556577.12371.3906301590138493354@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: sis X-Git-Refname: refs/heads/geoapi-4.0 X-Git-Reftype: branch X-Git-Rev: f2c4c2308f30e4b07b6698c73329c9e6162c8f60 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20200617173925.E0883890B2@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git commit f2c4c2308f30e4b07b6698c73329c9e6162c8f60 Author: Martin Desruisseaux AuthorDate: Wed Jun 17 16:13:20 2020 +0200 Fix image transparency. --- .../src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java index 57cd3c9..6816258 100644 --- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java +++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java @@ -18,6 +18,7 @@ package org.apache.sis.gui.map; import java.util.Locale; import java.nio.IntBuffer; +import java.awt.AlphaComposite; import java.awt.Graphics2D; import java.awt.GraphicsEnvironment; import java.awt.GraphicsConfiguration; @@ -388,13 +389,13 @@ public abstract class MapCanvasAWT extends MapCanvas { VolatileImage drawTo = previousBuffer; previousBuffer = null; // For letting GC do its work. if (drawTo == null) { - drawTo = configuration.createCompatibleVolatileImage(width, height); + drawTo = configuration.createCompatibleVolatileImage(width, height, VolatileImage.TRANSLUCENT); } boolean invalid = true; try { do { if (drawTo.validate(configuration) == VolatileImage.IMAGE_INCOMPATIBLE) { - drawTo = configuration.createCompatibleVolatileImage(width, height); + drawTo = configuration.createCompatibleVolatileImage(width, height, VolatileImage.TRANSLUCENT); } final Graphics2D gr = drawTo.createGraphics(); try { @@ -422,6 +423,7 @@ public abstract class MapCanvasAWT extends MapCanvas { final VolatileImage drawTo = doubleBuffer; final Graphics2D gr = buffer.createGraphics(); try { + gr.setComposite(AlphaComposite.Src); // Copy source (previous destination is discarded). gr.drawImage(drawTo, 0, 0, null); contentsLost = drawTo.contentsLost(); } finally {