change hint to DISABLE_OPTIMIZED_STROKE (issue #1302)

This commit is contained in:
benfry
2012-12-06 17:48:26 +00:00
parent a60e8a1a6d
commit 8a1bbecefd
8 changed files with 33 additions and 22 deletions
@@ -406,8 +406,8 @@ public interface PConstants {
static final int DISABLE_DEPTH_MASK = 5;
static final int ENABLE_DEPTH_MASK = -5;
static final int ENABLE_ACCURATE_2D = 6;
static final int DISABLE_ACCURATE_2D = -6;
static final int DISABLE_OPTIMIZED_STROKE = 6;
static final int ENABLE_OPTIMIZED_STROKE = -6;
static final int ENABLE_STROKE_PERSPECTIVE = 7;
static final int DISABLE_STROKE_PERSPECTIVE = -7;
@@ -1946,10 +1946,10 @@ public class PGraphicsOpenGL extends PGraphics {
} else if (which == ENABLE_DEPTH_MASK) {
flush();
pgl.depthMask(true);
} else if (which == DISABLE_ACCURATE_2D) {
} else if (which == ENABLE_OPTIMIZED_STROKE) {
flush();
setFlushMode(FLUSH_WHEN_FULL);
} else if (which == ENABLE_ACCURATE_2D) {
} else if (which == DISABLE_OPTIMIZED_STROKE) {
flush();
setFlushMode(FLUSH_CONTINUOUSLY);
} else if (which == DISABLE_STROKE_PERSPECTIVE) {
@@ -5910,7 +5910,7 @@ public class PGraphicsOpenGL extends PGraphics {
// use <= since that's what processing.core does
pgl.depthFunc(PGL.LEQUAL);
if (hints[ENABLE_ACCURATE_2D]) {
if (hints[DISABLE_OPTIMIZED_STROKE]) {
flushMode = FLUSH_CONTINUOUSLY;
} else {
flushMode = FLUSH_WHEN_FULL;
@@ -7029,7 +7029,7 @@ public class PGraphicsOpenGL extends PGraphics {
setUniformValue(perspectiveLoc, 0);
}
if (pgCurrent.getHint(ENABLE_ACCURATE_2D)) {
if (pgCurrent.getHint(DISABLE_OPTIMIZED_STROKE)) {
setUniformValue(scaleLoc, 1.0f, 1.0f, 1.0f);
} else {
if (usingOrthoProjection) {
@@ -4225,7 +4225,7 @@ public class PShapeOpenGL extends PShape {
// Or accurate 2D mode is enabled, which forces each
// shape to be rendered separately.
protected boolean fragmentedGroup(PGraphicsOpenGL g) {
return g.getHint(ENABLE_ACCURATE_2D) ||
return g.getHint(DISABLE_OPTIMIZED_STROKE) ||
(textures != null && 1 < textures.size()) ||
strokedTexture;
}