mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8364214: Enhance polygon data support
Reviewed-by: rhalade, psadhukhan, mschoene, prr
This commit is contained in:
parent
f8fb780426
commit
9f3f960b36
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1901,9 +1901,9 @@ public final class SunGraphics2D
|
||||
if (usrClip == null) {
|
||||
clipState = CLIP_DEVICE;
|
||||
clipRegion = devClip;
|
||||
} else if (usrClip instanceof Rectangle2D) {
|
||||
} else if (usrClip instanceof Rectangle2D clip) {
|
||||
clipState = CLIP_RECTANGULAR;
|
||||
clipRegion = devClip.getIntersection((Rectangle2D) usrClip);
|
||||
clipRegion = devClip.getIntersection(clip);
|
||||
} else {
|
||||
PathIterator cpi = usrClip.getPathIterator(null);
|
||||
int[] box = new int[4];
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,6 +27,8 @@ package sun.java2d.pipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
|
||||
import sun.java2d.InvalidPipeException;
|
||||
import sun.java2d.SunGraphics2D;
|
||||
|
||||
/**
|
||||
@ -67,7 +69,9 @@ public class SpanClipRenderer implements CompositePipe
|
||||
public Object startSequence(SunGraphics2D sg, Shape s, Rectangle devR,
|
||||
int[] abox) {
|
||||
RegionIterator ri = sg.clipRegion.getIterator();
|
||||
|
||||
if (ri.region.isRectangular()) {
|
||||
throw new InvalidPipeException("Invalid clip data");
|
||||
}
|
||||
return new SCRcontext(ri, outpipe.startSequence(sg, s, devR, abox));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user