Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: src/gpu/GrGpu.cpp

Issue 22686002: Implement path cover with nv_path_rendering (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Omission with non-inverted path bounds fixed Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
« src/gpu/GrGpu.h ('K') | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698