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;
}
+8
View File
@@ -27,6 +27,14 @@ PROCESSING 2.0b7 (REV 0215) - 25 November 2012
If we're missing anything that's not covered in the reference, please
let us know via the bugs database.
+ hint(ENABLE_ACCURATE_2D) has been renamed to hint(DISABLE_OPTIMIZED_STROKE)
to better reflect what it actually does. Reference has been added.
OpenGL drawing is significantly faster when the fill and stroke of a shape
is drawn separately. This leads to visual artifacts on shapes where both
fill and stroke is enabled (not a great idea in 3D anyway), so this option
fixes the visual artifacts at the expense of speed.
http://code.google.com/p/processing/issues/detail?id=1302
+ Sketch names can no longer begin with underscores (fixes an Android
compatibility issue). This was changed in recent releases, but missing here.
http://code.google.com/p/processing/issues/detail?id=859
+2 -2
View File
@@ -453,8 +453,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) {
+1 -1
View File
@@ -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;
}
+11 -8
View File
@@ -91,10 +91,18 @@ X also store the default composite instance and use that on blendMode(BLEND)
X disable Quartz renderer to fix line blending problem from Casey
X might make sketches run more slowly
X fix double error report about textMode(SCREEN)
X how to handle stroke/fill separation in OpenGL
X hint(DISABLE_OPTIMIZED_STROKE)
X http://code.google.com/p/processing/issues/detail?id=1302
X change name for hint() that controls stroke/fill combo:
_ implement mousePressed(Event) etc
_ better to do this instead of bringing back the magic event
_ or implementing the magic event on Android
_ add mouse wheel support to 2.0 event system
_ this is fairly messy since desktop and JS behave a little differently
_ wheel event should subclass mouse (since position still relevant)
_ might be more effort than it's worth?
_ http://code.google.com/p/processing/issues/detail?id=1423
andres (cleanup)
@@ -235,15 +243,12 @@ _ so that it could avoid quitting if the sketch hasn't been stopped
_ or if the sketch window is foremost
_ maybe a hack where a new menubar is added?
_ how to handle stroke/fill separation in OpenGL
_ http://code.google.com/p/processing/issues/detail?id=1302
_ shader syntax (Andres request)
_ might also need a define inside the shader to control what type it is
_ createShape() not yet implemented for Java2D
_ http://code.google.com/p/processing/issues/detail?id=1400
_ shader syntax (Andres request)
_ might also need a define inside the shader to control what type it is
_ look into json and how it would work
1) we bring back getFloatAttribute() et al., and make getFloat() be equivalent to parseFloat(xml.getContent())
2) we keep getFloat() like it is, and add getFloatContent(), getIntContent() etc.
@@ -296,6 +301,7 @@ _ add "CGAffineTransformInvert: singular matrix" problem to the Wiki
_ http://code.google.com/p/processing/issues/detail?id=1363
_ heading2D()? weird.. angle?
_ http://toxiclibs.org/docs/core/toxi/geom/Vec3D.html
_ http://code.google.com/p/processing/issues/detail?id=987
_ "translate, or this variation of it" when using text(s, x, y, z) accidentally
@@ -307,9 +313,6 @@ _ http://code.google.com/p/processing/issues/detail?id=1353
_ Default Renderer slow on retina displays
_ http://code.google.com/p/processing/issues/detail?id=1262
_ change name for hint() that controls stroke/fill combo
_ hint(DISABLE_OPTIMIZED_STROKE)
_ hint(OPENGL_ERRORS) should be the opposite to enable the reporting, no?
_ fillMode(NONZERO) and fillMode(ODD) to replace sold(boolean)?