Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index f14515462ad1f1883bba30dc930d4faef233b3b1..4838cdd6788bdb834dcd8cfa1c404a3f95f9e39d 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -6,9 +6,9 @@ |
* found in the LICENSE file. |
*/ |
- |
- |
#include "GrDrawTarget.h" |
+ |
+#include "GrBatch.h" |
#include "GrContext.h" |
#include "GrDrawTargetCaps.h" |
#include "GrPath.h" |
@@ -522,6 +522,30 @@ void GrDrawTarget::drawNonIndexed(GrDrawState* ds, |
} |
} |
+ |
+void GrDrawTarget::batchDraw(GrDrawState* ds, |
+ GrBatch* batch, |
+ GrPrimitiveType type, |
+ const SkRect* devBounds) { |
+ SkASSERT(ds); |
+ // TODO some kind of checkdraw, but not at this level |
+ |
+ // Setup clip |
+ GrScissorState scissorState; |
+ GrDrawState::AutoRestoreEffects are; |
+ GrDrawState::AutoRestoreStencil ars; |
+ if (!this->setupClip(ds, &are, &ars, &scissorState, devBounds)) { |
+ return; |
+ } |
+ |
+ GrDeviceCoordTexture dstCopy; |
+ if (!this->setupDstReadIfNecessary(ds, &dstCopy, devBounds)) { |
+ return; |
+ } |
+ |
+ this->onBatchDraw(batch, *ds, type, scissorState, dstCopy.texture() ? &dstCopy : NULL); |
+} |
+ |
static const GrStencilSettings& winding_path_stencil_settings() { |
GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, |
kIncClamp_StencilOp, |