Mainly added because it's useful for rendering in wireframe mode.
Change-Id: I84dab43ce5b56a48d47dd16d4c98fa7648bb1f0b
Reviewed-on: https://skia-review.googlesource.com/10530
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMemoryBarrierProc)(GrGLbitfield barriers);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMemoryBarrierByRegionProc)(GrGLbitfield barriers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
+typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPolygonModeProc)(GrGLenum face, GrGLenum mode);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPopGroupMarkerProc)();
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPushGroupMarkerProc)(GrGLsizei length, const char* marker);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLQueryCounterProc)(GrGLuint id, GrGLenum target);
GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
+ GrGLFunction<GrGLPolygonModeProc> fPolygonMode;
GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker;
GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker;
GrGLFunction<GrGLQueryCounterProc> fQueryCounter;
}
GET_PROC(PixelStorei);
+ GET_PROC(PolygonMode);
if (extensions.has("GL_EXT_raster_multisample")) {
GET_PROC_SUFFIX(RasterSamples, EXT);
}
#define GR_GL_LINE_WIDTH_GRANULARITY 0x0B23
#define GR_GL_LINE_WIDTH_RANGE 0x0B22
+/* PolygonMode */
+#define GR_GL_POINT 0x1B00
+#define GR_GL_LINE 0x1B01
+#define GR_GL_FILL 0x1B02
+
/* Unsized formats */
#define GR_GL_STENCIL_INDEX 0x1901
#define GR_GL_DEPTH_COMPONENT 0x1902
GL_CALL(Disable(GR_GL_COLOR_TABLE));
}
GL_CALL(Disable(GR_GL_POLYGON_OFFSET_FILL));
+
+ GL_CALL(PolygonMode(GR_GL_FRONT_AND_BACK, GR_GL_FILL));
#endif
// Since ES doesn't support glPointSize at all we always use the VS to
// set the point size
GL_CALL(Enable(GR_GL_VERTEX_PROGRAM_POINT_SIZE));
- // We should set glPolygonMode(FRONT_AND_BACK,FILL) here, too. It isn't
- // currently part of our gl interface. There are probably others as
- // well.
}
if (kGLES_GrGLStandard == this->glStandard() &&
if (glVer >= GR_GL_VER(2,0)) {
if (nullptr == fFunctions.fStencilFuncSeparate ||
nullptr == fFunctions.fStencilMaskSeparate ||
- nullptr == fFunctions.fStencilOpSeparate) {
+ nullptr == fFunctions.fStencilOpSeparate ||
+ nullptr == fFunctions.fPolygonMode) {
RETURN_FALSE_INTERFACE
}
}
fFunctions.fMapTexSubImage2D = bind_to_member(this, &GrGLTestInterface::mapTexSubImage2D);
fFunctions.fMinSampleShading = bind_to_member(this, &GrGLTestInterface::minSampleShading);
fFunctions.fPixelStorei = bind_to_member(this, &GrGLTestInterface::pixelStorei);
+ fFunctions.fPolygonMode = bind_to_member(this, &GrGLTestInterface::polygonMode);
fFunctions.fPopGroupMarker = bind_to_member(this, &GrGLTestInterface::popGroupMarker);
fFunctions.fPushGroupMarker = bind_to_member(this, &GrGLTestInterface::pushGroupMarker);
fFunctions.fQueryCounter = bind_to_member(this, &GrGLTestInterface::queryCounter);
virtual GrGLvoid* mapTexSubImage2D(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access) { return nullptr; }
virtual GrGLvoid minSampleShading(GrGLfloat value) {}
virtual GrGLvoid pixelStorei(GrGLenum pname, GrGLint param) {}
+ virtual GrGLvoid polygonMode(GrGLenum face, GrGLenum mode) {}
virtual GrGLvoid popGroupMarker() {}
virtual GrGLvoid pushGroupMarker(GrGLsizei length, const char* marker) {}
virtual GrGLvoid queryCounter(GrGLuint id, GrGLenum target) {}