Index: src/gpu/GrDrawContext.cpp |
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp |
index 1969bd03be29063f62139f16bb4e246aad63ba9e..db9d03b374ad2a30992c58cf485dd688da525b8b 100644 |
--- a/src/gpu/GrDrawContext.cpp |
+++ b/src/gpu/GrDrawContext.cpp |
@@ -21,6 +21,8 @@ |
#include "batches/GrDrawVerticesBatch.h" |
#include "batches/GrRectBatchFactory.h" |
+#include "draws/GrDraw.h" |
+ |
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fContext) |
#define RETURN_IF_ABANDONED if (!fDrawTarget) { return; } |
#define RETURN_FALSE_IF_ABANDONED if (!fDrawTarget) { return false; } |
@@ -279,7 +281,7 @@ void GrDrawContext::drawRect(GrRenderTarget* rt, |
} else { |
SkRect devBoundRect; |
viewMatrix.mapRect(&devBoundRect, rect); |
- batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect, devBoundRect)); |
+ batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect)); |
} |
fDrawTarget->drawBatch(pipelineBuilder, batch); |
return; |
@@ -759,6 +761,17 @@ bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) { |
return true; |
} |
-void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch) { |
- fDrawTarget->drawBatch(*pipelineBuilder, batch); |
+void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBatch* batch) { |
+ RETURN_IF_ABANDONED |
+ |
+ AutoCheckFlush acf(fContext); |
+ // The caller will assert it owns the rendertarget |
+ |
+ fDrawTarget->drawBatch(pipelineBuilder, batch); |
+} |
+ |
+GrBatch* GrDrawContext::lastBatch() { |
+ RETURN_NULL_IF_ABANDONED |
+ |
+ return fDrawTarget->lastBatch(); |
} |