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

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 683673002: clear stencil clip on draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@aa_rect_takes_gpu
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 47fff6f90cf2d55ca1635449b87b4593c2ce7c47..dcd09ddeb105773b3f2d5366ef88efe94ee07f05 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -17,7 +17,7 @@
GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrGpu* gpu,
GrVertexBufferAllocPool* vertexPool,
GrIndexBufferAllocPool* indexPool)
- : GrDrawTarget(gpu->getContext())
+ : INHERITED(gpu->getContext())
, fCmdBuffer(kCmdBufferInitialSizeInBytes)
, fLastState(NULL)
, fLastClip(NULL)
@@ -434,6 +434,19 @@ void GrInOrderDrawBuffer::clear(const SkIRect* rect, GrColor color,
this->recordTraceMarkersIfNecessary();
}
+void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect,
+ bool insideClip,
+ GrRenderTarget* renderTarget) {
+ if (NULL == renderTarget) {
+ renderTarget = this->drawState()->getRenderTarget();
+ SkASSERT(renderTarget);
+ }
+ ClearStencilClip* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, ClearStencilClip, (renderTarget));
+ clr->fRect = rect;
+ clr->fInsideClip = insideClip;
+ this->recordTraceMarkersIfNecessary();
+}
+
void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
if (!this->caps()->discardRenderTargetSupport()) {
return;
@@ -523,7 +536,7 @@ void GrInOrderDrawBuffer::flush() {
++fDrawID;
}
-void GrInOrderDrawBuffer::Draw::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::Draw::execute(GrClipTarget* gpu) {
gpu->setVertexSourceToBuffer(this->vertexBuffer());
if (fInfo.isIndexed()) {
gpu->setIndexSourceToBuffer(this->indexBuffer());
@@ -531,30 +544,30 @@ void GrInOrderDrawBuffer::Draw::execute(GrDrawTarget* gpu) {
gpu->executeDraw(fInfo);
}
-void GrInOrderDrawBuffer::StencilPath::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::StencilPath::execute(GrClipTarget* gpu) {
gpu->stencilPath(this->path(), fFill);
}
-void GrInOrderDrawBuffer::DrawPath::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::DrawPath::execute(GrClipTarget* gpu) {
gpu->executeDrawPath(this->path(), fFill, fDstCopy.texture() ? &fDstCopy : NULL);
}
-void GrInOrderDrawBuffer::DrawPaths::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::DrawPaths::execute(GrClipTarget* gpu) {
gpu->executeDrawPaths(this->pathRange(), this->indices(), fCount, this->transforms(),
fTransformsType, fFill, fDstCopy.texture() ? &fDstCopy : NULL);
}
-void GrInOrderDrawBuffer::SetState::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::SetState::execute(GrClipTarget* gpu) {
gpu->setDrawState(&fState);
}
-void GrInOrderDrawBuffer::SetClip::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::SetClip::execute(GrClipTarget* gpu) {
// Our fClipData is referenced directly, so we must remain alive for the entire
// duration of the flush (after which the gpu's previous clip is restored).
gpu->setClip(&fClipData);
}
-void GrInOrderDrawBuffer::Clear::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::Clear::execute(GrClipTarget* gpu) {
if (GrColor_ILLEGAL == fColor) {
gpu->discard(this->renderTarget());
} else {
@@ -562,7 +575,11 @@ void GrInOrderDrawBuffer::Clear::execute(GrDrawTarget* gpu) {
}
}
-void GrInOrderDrawBuffer::CopySurface::execute(GrDrawTarget* gpu) {
+void GrInOrderDrawBuffer::ClearStencilClip::execute(GrClipTarget* gpu) {
+ gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget());
+}
+
+void GrInOrderDrawBuffer::CopySurface::execute(GrClipTarget* gpu) {
gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint);
}
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698