}
/* TODO: Turn antialiasing on/off */
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POLYGON_SMOOTH);
- glEnable(GL_MULTISAMPLE);
+// glDisable(GL_LINE_SMOOTH);
+// glDisable(GL_POLYGON_SMOOTH);
+// glEnable(GL_MULTISAMPLE);
/* Pick paint if available or default*/
fill = (context->fillPaint ? context->fillPaint : &context->defaultPaint);
/* TODO: Is there any way to do this safely along
with the paint generation pass?? */
glDisable(GL_BLEND);
- glDisable(GL_MULTISAMPLE);
+// glDisable(GL_MULTISAMPLE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
shDrawBoundBox(context, p, VG_FILL_PATH);
/* Reset state */
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDisable(GL_STENCIL_TEST);
- glDisable(GL_BLEND);
+// glDisable(GL_BLEND);
}
/* TODO: Turn antialiasing on/off */
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POLYGON_SMOOTH);
- glEnable(GL_MULTISAMPLE);
+// glDisable(GL_LINE_SMOOTH);
+// glDisable(GL_POLYGON_SMOOTH);
+// glEnable(GL_MULTISAMPLE);
if ((paintModes & VG_STROKE_PATH) &&
context->strokeLineWidth > 0.0f) {
-
- if (1) {/*context->strokeLineWidth > 1.0f) {*/
+#if 0
+ if (1) {/*context->strokeLineWidth > 1.0f) {*/
+#endif
if (shIsStrokeCacheValid( context, p ) == VG_FALSE)
{
/* Generate stroke triangles in user space */
/* Clear stencil for sure */
glDisable(GL_BLEND);
- glDisable(GL_MULTISAMPLE);
+// glDisable(GL_MULTISAMPLE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
shDrawBoundBox(context, p, VG_STROKE_PATH);
/* Reset state */
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDisable(GL_STENCIL_TEST);
- glDisable(GL_BLEND);
-
+// glDisable(GL_BLEND);
+#if 0
}else{
/* Simulate thin stroke by alpha */
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
}
+#endif
}
state->setClientActiveTextureUnit(0);
state->disableAllVertexArrays();
- glPushAttrib(~0u); // Don't use GL_ALL_ATTRIB_BITS as on my machine it
- // eg. doesn't include GL_MULTISAMPLE_BIT
- glPushClientAttrib(~0u);
+ bool was_blend_enabled = state->getLastAppliedMode(GL_BLEND);
+ bool was_stencil_enabled = state->getLastAppliedMode(GL_STENCIL_TEST);
// Initialize/Update the paint
if( _attributes_dirty & STROKE_COLOR )
if( err != VG_NO_ERROR )
SG_LOG(SG_GL, SG_ALERT, "vgError: " << err);
- glPopAttrib();
- glPopClientAttrib();
+ if( was_blend_enabled ) glEnable(GL_BLEND);
+ if( was_stencil_enabled ) glEnable(GL_STENCIL_TEST);
}
osg::BoundingBox getTransformedBounds(const osg::Matrix& mat) const