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

Unified Diff: src/gpu/GrOptDrawState.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/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index a11100711486490f9b586bc317c3abb4cb6ec050..958a5fdfb134d12ead735824d1e649488bb98fb2 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -7,6 +7,7 @@
#include "GrOptDrawState.h"
+#include "GrBatch.h"
#include "GrDrawState.h"
#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
@@ -21,6 +22,30 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc);
const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc);
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy);
+}
+
+GrOptDrawState::GrOptDrawState(GrBatch* batch,
+ const GrDrawState& drawState,
+ const GrDrawTargetCaps& caps,
+ const GrScissorState& scissorState,
+ const GrDeviceCoordTexture* dstCopy) {
+ GrBatchOpt batchOpt;
+ batchOpt.fCanTweakAlphaForCoverage = drawState.canTweakAlphaForCoverage();
+ batch->initBatchOpt(batchOpt);
+
+ const GrProcOptInfo& colorPOI = drawState.colorProcInfo(batch);
+ const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(batch);
+
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy);
+}
+
+void GrOptDrawState::internalConstructor(const GrDrawState& drawState,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ const GrDrawTargetCaps& caps,
+ const GrScissorState& scissorState,
+ const GrDeviceCoordTexture* dstCopy) {
// Create XferProcessor from DS's XPFactory
SkAutoTUnref<GrXferProcessor> xferProcessor(
drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI));

Powered by Google App Engine
This is Rietveld 408576698