| Index: src/gpu/gl/GrGpuGL.cpp
|
| diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
|
| index b4111950c1ab6276a744c7df69cfa3967efa534d..09c0fdce739ce43abccf65dad085d01353156db6 100644
|
| --- a/src/gpu/gl/GrGpuGL.cpp
|
| +++ b/src/gpu/gl/GrGpuGL.cpp
|
| @@ -12,6 +12,7 @@
|
| #include "GrGLShaderBuilder.h"
|
| #include "GrTemplates.h"
|
| #include "GrTypes.h"
|
| +#include "SkStrokeRec.h"
|
| #include "SkTemplates.h"
|
|
|
| static const GrGLuint GR_MAX_GLUINT = ~0U;
|
| @@ -1273,9 +1274,9 @@ GrIndexBuffer* GrGpuGL::onCreateIndexBuffer(uint32_t size, bool dynamic) {
|
| }
|
| }
|
|
|
| -GrPath* GrGpuGL::onCreatePath(const SkPath& inPath) {
|
| +GrPath* GrGpuGL::onCreatePath(const SkPath& inPath, const SkStrokeRec& stroke) {
|
| SkASSERT(this->caps()->pathRenderingSupport());
|
| - return SkNEW_ARGS(GrGLPath, (this, inPath));
|
| + return SkNEW_ARGS(GrGLPath, (this, inPath, stroke));
|
| }
|
|
|
| void GrGpuGL::flushScissor() {
|
| @@ -1728,7 +1729,7 @@ void GrGpuGL::onGpuStencilPath(const GrPath* path, SkPath::FillType fill) {
|
| GL_CALL(StencilFillPath(id, fillMode, writeMask));
|
| }
|
|
|
| -void GrGpuGL::onGpuFillPath(const GrPath* path, SkPath::FillType fill) {
|
| +void GrGpuGL::onGpuDrawPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::FillType fill) {
|
| SkASSERT(this->caps()->pathRenderingSupport());
|
|
|
| GrGLuint id = static_cast<const GrGLPath*>(path)->pathID();
|
| @@ -1736,25 +1737,38 @@ void GrGpuGL::onGpuFillPath(const GrPath* path, SkPath::FillType fill) {
|
| SkASSERT(NULL != drawState->getRenderTarget());
|
| SkASSERT(NULL != drawState->getRenderTarget()->getStencilBuffer());
|
|
|
| - SkPath::FillType nonInvertedFill = SkPath::ConvertToNonInverseFillType(fill);
|
| SkASSERT(!fPathStencilSettings.isTwoSided());
|
| GrGLenum fillMode =
|
| gr_stencil_op_to_gl_path_rendering_fill_mode(fPathStencilSettings.passOp(GrStencilSettings::kFront_Face));
|
| GrGLint writeMask = fPathStencilSettings.writeMask(GrStencilSettings::kFront_Face);
|
| - GL_CALL(StencilFillPath(id, fillMode, writeMask));
|
|
|
| - if (!fCurrentProgram->hasVertexShader() && nonInvertedFill == fill) {
|
| - GL_CALL(CoverFillPath(id, GR_GL_BOUNDING_BOX));
|
| + if (stroke.isFillStyle() || SkStrokeRec::kStrokeAndFill_Style == stroke.getStyle()) {
|
| + GL_CALL(StencilFillPath(id, fillMode, writeMask));
|
| + }
|
| +
|
| + if (stroke.needToApply()) {
|
| + GL_CALL(StencilStrokePath(id, 0xffff, writeMask));
|
| + }
|
| +
|
| + bool isInverseFill = SkPath::ConvertToNonInverseFillType(fill) != fill;
|
| +
|
| + if (!fCurrentProgram->hasVertexShader() && !isInverseFill) {
|
| + if (stroke.needToApply()) {
|
| + GL_CALL(CoverStrokePath(id, GR_GL_BOUNDING_BOX));
|
| + } else {
|
| + GL_CALL(CoverFillPath(id, GR_GL_BOUNDING_BOX));
|
| + }
|
| } else {
|
| GrDrawState::AutoViewMatrixRestore avmr;
|
| + SkMatrix vmi;
|
| SkRect bounds;
|
| - if (nonInvertedFill == fill) {
|
| + if (!isInverseFill) {
|
| bounds = path->getBounds();
|
| } else {
|
| bounds = SkRect::MakeLTRB(0, 0,
|
| SkIntToScalar(drawState->getRenderTarget()->width()),
|
| - SkIntToScalar(drawState->getRenderTarget()->height()));
|
| - SkMatrix vmi;
|
| + SkIntToScalar(drawState->getRenderTarget()->height()));
|
| +
|
| // mapRect through persp matrix may not be correct
|
| if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewInverse(&vmi)) {
|
| vmi.mapRect(&bounds);
|
| @@ -1892,7 +1906,7 @@ void set_gl_stencil(const GrGLInterface* gl,
|
| }
|
|
|
| void GrGpuGL::flushStencil(DrawType type) {
|
| - if ((kStencilPath_DrawType == type || kFillPath_DrawType == type) &&
|
| + if ((kStencilPath_DrawType == type || kDrawPath_DrawType == type) &&
|
| fHWPathStencilSettings != fPathStencilSettings) {
|
|
|
| // Just the func, ref, and mask is set here. The op and write mask are params to the call
|
| @@ -2227,7 +2241,6 @@ void GrGpuGL::enableTexGen(int unitIdx, int numComponents, const GrGLfloat* coef
|
| }
|
|
|
| void GrGpuGL::enableTexGen(int unitIdx, int numComponents, const SkMatrix& matrix) {
|
| -
|
| GrGLfloat coefficients[9];
|
| SkASSERT(this->glCaps().fixedFunctionSupport());
|
| SkASSERT(numComponents <= 3 && numComponents > 0);
|
|
|