modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java
Print this page
@@ -59,10 +59,11 @@
import com.sun.javafx.geom.Shape;
import com.sun.javafx.geom.transform.Affine2D;
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.javafx.geom.transform.GeneralTransform3D;
import com.sun.javafx.logging.PulseLogger;
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED;
import com.sun.javafx.tk.Toolkit;
import com.sun.prism.BasicStroke;
import com.sun.prism.Graphics;
import com.sun.prism.Image;
import com.sun.prism.RTTexture;
@@ -626,12 +627,12 @@
// Have to move the origin such that when rendering to x=0, we actually end up rendering
// at x=bounds.getMinX(). Otherwise anything rendered to the left of the origin would be lost
cachedGraphics.translate(rect.x - outsetShapeBounds.getMinX(),
rect.y - outsetShapeBounds.getMinY());
renderBackgroundShape(cachedGraphics);
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("Rendering region shape image to cache");
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("Rendering region shape image to cache");
}
}
}
}
@@ -648,12 +649,12 @@
final float srcY1 = rect.y;
final float srcX2 = srcX1 + textureWidth;
final float srcY2 = srcY1 + textureHeight;
g.drawTexture(cached, dstX1, dstY1, dstX2, dstY2, srcX1, srcY1, srcX2, srcY2);
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("Cached region shape image used");
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("Cached region shape image used");
}
} else {
// no cache, rendering backgrounds directly to graphics
renderBackgroundShape(g);
}
@@ -682,13 +683,13 @@
}
}
}
private void renderBackgroundShape(Graphics g) {
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("NGRegion renderBackgroundShape slow path");
- PulseLogger.PULSE_LOGGER.renderMessage("Slow shape path for " + getName());
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("NGRegion renderBackgroundShape slow path");
+ PulseLogger.addMessage("Slow shape path for " + getName());
}
// We first need to draw each background fill. We don't pay any attention
// to the radii of the BackgroundFill, but we do honor the insets and
// the fill paint itself.
@@ -826,12 +827,12 @@
cacheGraphics.translate(rect.x + outsetsLeft, rect.y + outsetsTop);
// Rendering backgrounds to the cache
renderBackgroundRectanglesDirectly(cacheGraphics, cacheWidth, cacheHeight);
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("Rendering region background image to cache");
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("Rendering region background image to cache");
}
}
}
}
@@ -1059,12 +1060,12 @@
srcX1, srcY1, srcX2, srcY2,
dstLeftX, dstTopY, dstRightX, dstBottomY,
srcLeftX, srcTopY, srcRightX, srcBottomY);
}
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("Cached region background image used");
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("Cached region background image used");
}
}
private void renderBackgroundRectanglesDirectly(Graphics g, float width, float height) {
final List<BackgroundFill> fills = background.getFills();
@@ -1108,13 +1109,13 @@
if (arcWidth > w) arcWidth = w;
if (arcHeight > h) arcHeight = h;
g.fillRoundRect(l, t, w, h, arcWidth, arcHeight);
}
} else {
- if (PulseLogger.PULSE_LOGGING_ENABLED) {
- PulseLogger.PULSE_LOGGER.renderIncrementCounter("NGRegion renderBackgrounds slow path");
- PulseLogger.PULSE_LOGGER.renderMessage("Slow background path for " + getName());
+ if (PULSE_LOGGING_ENABLED) {
+ PulseLogger.incrementCounter("NGRegion renderBackgrounds slow path");
+ PulseLogger.addMessage("Slow background path for " + getName());
}
// The edges are not uniform, so we have to render each edge independently
// TODO document the issue number which will give us a fast path for rendering
// non-uniform corners, and that we want to implement that instead of createPath2
// below in such cases. (RT-26979)