summaryrefslogtreecommitdiff
path: root/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/awt/peer/gtk/BufferedImageGraphics.java')
-rw-r--r--gnu/java/awt/peer/gtk/BufferedImageGraphics.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
index 5412cbea9..e188d3fd0 100644
--- a/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+++ b/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
@@ -158,6 +158,7 @@ public class BufferedImageGraphics extends CairoGraphics2D
BufferedImageGraphics(BufferedImageGraphics copyFrom)
{
+ image = copyFrom.image;
surface = copyFrom.surface;
cairo_t = surface.newCairoContext();
imageWidth = copyFrom.imageWidth;
@@ -182,6 +183,9 @@ public class BufferedImageGraphics extends CairoGraphics2D
width = imageWidth - x;
if( y + height > imageHeight )
height = imageHeight - y;
+
+ boolean wasPremultiplied = image.isAlphaPremultiplied();
+ image.coerceData(true);
if( !hasFastCM )
image.setRGB(x, y, width, height, pixels,
@@ -190,6 +194,8 @@ public class BufferedImageGraphics extends CairoGraphics2D
System.arraycopy(pixels, y * imageWidth,
((DataBufferInt)image.getRaster().getDataBuffer()).
getData(), y * imageWidth, height * imageWidth);
+
+ image.coerceData(wasPremultiplied);
}
/**