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

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: rebased to issue 23537028 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..f8c528150c7c39e25cf2203e2699b3aa1fa039af 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -349,10 +349,8 @@ 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->drawState()->setStencilPathSettings(this->getStencilPathSettings(*path, fill));
- this->setStencilPathSettings(*path, fill, this->drawState()->stencil());
GrDrawState::AutoRestoreEffects are;
if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) {
return;
@@ -361,6 +359,20 @@ void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy
this->onGpuStencilPath(path, fill);
}
+void GrGpu::onDrawPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::FillType fill) {
+ this->handleDirtyContext();
+
+ this->drawState()->setStencilPathSettings(this->getStencilPathSettings(*path, fill));
+
+ GrDrawState::AutoRestoreEffects are;
+ // TODO: Some blending effects require destination texture, see onDraw
+ if (!this->setupClipAndFlushState(kDrawPath_DrawType, NULL, &are)) {
+ return;
+ }
+
+ this->onGpuDrawPath(path, fill);
+}
+
void GrGpu::finalizeReservedVertices() {
SkASSERT(NULL != fVertexPool);
fVertexPool->unlock();

Powered by Google App Engine
This is Rietveld 408576698