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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: a bit more tweaking Created 5 years, 11 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/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,

Powered by Google App Engine
This is Rietveld 408576698