Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259042: Inconsistent use of general primitives loops
Reviewed-by: prr
  • Loading branch information
mrserb committed Jan 6, 2021
1 parent e3b9da1 commit 8a05d6053211549d15ba469a18b497a3f8ec2b8c
Showing with 93 additions and 227 deletions.
  1. +5 −5 src/java.desktop/share/classes/sun/java2d/loops/Blit.java
  2. +9 −10 src/java.desktop/share/classes/sun/java2d/loops/BlitBg.java
  3. +6 −7 src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphList.java
  4. +6 −7 src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java
  5. +2 −20 src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java
  6. +1 −11 src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java
  7. +1 −11 src/java.desktop/share/classes/sun/java2d/loops/DrawParallelogram.java
  8. +3 −11 src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java
  9. +1 −11 src/java.desktop/share/classes/sun/java2d/loops/DrawPolygons.java
  10. +1 −11 src/java.desktop/share/classes/sun/java2d/loops/DrawRect.java
  11. +1 −11 src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java
  12. +3 −11 src/java.desktop/share/classes/sun/java2d/loops/FillPath.java
  13. +4 −5 src/java.desktop/share/classes/sun/java2d/loops/FillRect.java
  14. +2 −12 src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java
  15. +25 −17 src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java
  16. +6 −0 src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java
  17. +1 −8 src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java
  18. +5 −5 src/java.desktop/share/classes/sun/java2d/loops/MaskBlit.java
  19. +5 −5 src/java.desktop/share/classes/sun/java2d/loops/MaskFill.java
  20. +2 −19 src/java.desktop/share/classes/sun/java2d/loops/ScaledBlit.java
  21. +2 −21 src/java.desktop/share/classes/sun/java2d/loops/TransformBlit.java
  22. +2 −9 src/java.desktop/share/classes/sun/java2d/loops/TransformHelper.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, 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
@@ -32,7 +32,7 @@
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.lang.ref.WeakReference;
import sun.java2d.loops.GraphicsPrimitive;

import sun.java2d.SurfaceData;
import sun.java2d.pipe.Region;
import sun.java2d.pipe.SpanIterator;
@@ -114,9 +114,9 @@ public native void Blit(SurfaceData src, SurfaceData dst,
GraphicsPrimitiveMgr.registerGeneral(new Blit(null, null, null));
}

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
protected GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
/*
System.out.println("Constructing general blit for:");
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, 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
@@ -25,18 +25,17 @@

package sun.java2d.loops;

import java.awt.Font;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.AlphaComposite;
import java.awt.Transparency;
import java.awt.Font;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;
import java.awt.image.BufferedImage;

import sun.awt.image.BufImgSurfaceData;
import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SurfaceData;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import sun.java2d.pipe.Region;

/**
@@ -118,9 +117,9 @@ public native void BlitBg(SurfaceData src, SurfaceData dst,
GraphicsPrimitiveMgr.registerGeneral(new BlitBg(null, null, null));
}

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
protected GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
/*
System.out.println("Constructing general blitbg for:");
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@@ -25,11 +25,10 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.pipe.Region;
import sun.font.GlyphList;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import sun.font.GlyphList;
import sun.java2d.pipe.Region;

/**
* DrawGlyphList - loops for SolidTextRenderer pipe.
@@ -77,9 +76,9 @@ public native void DrawGlyphList(SunGraphics2D sg2d, SurfaceData dest,
new DrawGlyphList(null, null, null));
}

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype) {
protected GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype) {
return new General(srctype, comptype, dsttype);
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@@ -25,11 +25,10 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.pipe.Region;
import sun.font.GlyphList;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import sun.font.GlyphList;
import sun.java2d.pipe.Region;

/**
* DrawGlyphListAA - loops for AATextRenderer pipe
@@ -75,9 +74,9 @@ public native void DrawGlyphListAA(SunGraphics2D sg2d, SurfaceData dest,
new DrawGlyphListAA(null, null, null));
}

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype) {
protected GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype) {
return new General(srctype, comptype, dsttype);
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, 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
@@ -25,10 +25,9 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.font.GlyphList;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import sun.font.GlyphList;

/**
* DrawGlyphListLCD- loops for LCDTextRenderer pipe
@@ -71,23 +70,6 @@ public DrawGlyphListLCD(long pNativePrim,
public native void DrawGlyphListLCD(SunGraphics2D sg2d, SurfaceData dest,
GlyphList srcData);

static {
GraphicsPrimitiveMgr.registerGeneral(
new DrawGlyphListLCD(null, null, null));
}

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype) {
/* Do not return a General loop. SunGraphics2D determines whether
* to use LCD or standard AA text based on whether there is an
* installed loop.
* This can be uncommented once there is a General loop which can
* handle one byte per colour component masks properly.
*/
return null;
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawGlyphListLCD(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -29,7 +29,6 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;

@@ -74,15 +73,6 @@ public DrawLine(long pNativePrim,
public native void DrawLine(SunGraphics2D sg2d, SurfaceData dest,
int x1, int y1, int x2, int y2);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
// REMIND: use FillSpans or converter object?
throw new InternalError("DrawLine not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawLine(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021, 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
@@ -29,7 +29,6 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;

@@ -82,15 +81,6 @@ public native void DrawParallelogram(SunGraphics2D sg, SurfaceData dest,
double dx2, double dy2,
double lw1, double lw2);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
// REMIND: iterate with a FillRect primitive?
throw new InternalError("DrawParallelogram not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawParallelogram(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, 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
@@ -25,10 +25,10 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import java.awt.geom.Path2D;

import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import java.awt.geom.Path2D;

/**
* DrawPath
@@ -77,14 +77,6 @@ public native void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
int transX, int transY,
Path2D.Float p2df);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
throw new InternalError("DrawPath not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawPath(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -29,7 +29,6 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;

@@ -78,15 +77,6 @@ public native void DrawPolygons(SunGraphics2D sg2d, SurfaceData sData,
int transX, int transY,
boolean close);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
// REMIND: use FillSpans or converter object?
throw new InternalError("DrawPolygons not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawPolygons(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -29,7 +29,6 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;

@@ -75,15 +74,6 @@ public DrawRect(long pNativePrim,
public native void DrawRect(SunGraphics2D sg2d, SurfaceData dest,
int x1, int y1, int w, int h);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
// REMIND: use FillSpans or converter object?
throw new InternalError("DrawRect not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceDrawRect(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021, 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
@@ -29,7 +29,6 @@

package sun.java2d.loops;

import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;

@@ -79,15 +78,6 @@ public native void FillParallelogram(SunGraphics2D sg2d, SurfaceData dest,
double dx1, double dy1,
double dx2, double dy2);

public GraphicsPrimitive makePrimitive(SurfaceType srctype,
CompositeType comptype,
SurfaceType dsttype)
{
// REMIND: iterate with a FillRect primitive?
throw new InternalError("FillParallelogram not implemented for "+
srctype+" with "+comptype);
}

public GraphicsPrimitive traceWrap() {
return new TraceFillParallelogram(this);
}

0 comments on commit 8a05d60

Please sign in to comment.