Chromium Code Reviews| Index: src/gpu/GrGpu.cpp |
| diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
| index a4aa00eac12b53406a4cf0a02a82438c84743769..ac817f1db9593481527ac79b8d1bc5daa8a82256 100644 |
| --- a/src/gpu/GrGpu.cpp |
| +++ b/src/gpu/GrGpu.cpp |
| @@ -198,7 +198,7 @@ GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) { |
| } |
| GrPath* GrGpu::createPath(const SkPath& path) { |
| - SkASSERT(this->caps()->pathStencilingSupport()); |
| + SkASSERT(this->caps()->pathRenderingSupport()); |
| this->handleDirtyContext(); |
| return this->onCreatePath(path); |
| } |
| @@ -349,10 +349,11 @@ void GrGpu::onDraw(const DrawInfo& info) { |
| void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillType fill) { |
| this->handleDirtyContext(); |
| - // TODO: make this more efficient (don't copy and copy back) |
| - GrAutoTRestore<GrStencilSettings> asr(this->drawState()->stencil()); |
| + // This function might be called during clip flush of path fill. We need to restore the fill |
| + // type afterwards. |
| + GrAutoTRestore<SkPath::FillType> apsr(this->drawState()->pathStencilFillType()); |
|
bsalomon
2013/09/18 14:24:22
Now I see why you added the ptr getter. :/
Maybe
Kimmo Kinnunen
2013/09/20 12:20:58
I try to see if I can figure out a way. I was stru
|
| + this->drawState()->setPathStencilFillType(fill); |
| - this->setStencilPathSettings(*path, fill, this->drawState()->stencil()); |
| GrDrawState::AutoRestoreEffects are; |
| if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { |
| return; |
| @@ -361,6 +362,20 @@ void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy |
| this->onGpuStencilPath(path, fill); |
| } |
| +void GrGpu::onFillPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::FillType fill) { |
| + this->handleDirtyContext(); |
| + |
| + this->drawState()->setPathStencilFillType(fill); |
| + |
| + GrDrawState::AutoRestoreEffects are; |
| + // TODO: Some blending effects require destination texture, see onDraw |
| + if (!this->setupClipAndFlushState(kFillPath_DrawType, NULL, &are)) { |
| + return; |
| + } |
| + |
| + this->onGpuFillPath(path, fill); |
| +} |
| + |
| void GrGpu::finalizeReservedVertices() { |
| SkASSERT(NULL != fVertexPool); |
| fVertexPool->unlock(); |