aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrDrawContext.h8
-rw-r--r--src/gpu/GrDrawContext.cpp13
2 files changed, 21 insertions, 0 deletions
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 7a2223f78f..bb16011a46 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -259,6 +259,14 @@ public:
const GrStrokeInfo& strokeInfo);
+ /**
+ * Draws a batch
+ *
+ * @param paint describes how to color pixels.
+ * @param batch the batch to draw
+ */
+ void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrBatch*);
+
private:
friend class GrAtlasTextContext; // for access to drawBatch
friend class GrContext; // for ctor
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 6aa45a10a5..c5cb8559f3 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -656,6 +656,19 @@ static bool is_nested_rects(const SkMatrix& viewMatrix,
return allEq || allGoE1;
}
+void GrDrawContext::drawBatch(GrRenderTarget* rt, const GrClip& clip,
+ const GrPaint& paint, GrBatch* batch) {
+ RETURN_IF_ABANDONED
+
+ AutoCheckFlush acf(fContext);
+ if (!this->prepareToDraw(rt)) {
+ return;
+ }
+
+ GrPipelineBuilder pipelineBuilder(paint, rt, clip);
+ fDrawTarget->drawBatch(pipelineBuilder, batch);
+}
+
void GrDrawContext::drawPath(GrRenderTarget* rt,
const GrClip& clip,
const GrPaint& paint,