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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 845103005: GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: update devrect 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 8d28f446b27912d2d6e6687ef54485a73a93e326..92c249405d35c2f422d0c5287001775bc6eb0cea 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"
@@ -19,11 +20,40 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
const GrScissorState& scissorState,
const GrDeviceCoordTexture* dstCopy,
GrGpu::DrawType drawType) {
- fDrawType = drawType;
-
const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc);
const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc);
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy,
+ drawType);
+}
+
+GrOptDrawState::GrOptDrawState(GrBatch* batch,
+ const GrDrawState& drawState,
+ const GrDrawTargetCaps& caps,
+ const GrScissorState& scissorState,
+ const GrDeviceCoordTexture* dstCopy,
+ GrGpu::DrawType drawType) {
+ 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,
+ drawType);
+}
+
+void GrOptDrawState::internalConstructor(const GrDrawState& drawState,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ const GrDrawTargetCaps& caps,
+ const GrScissorState& scissorState,
+ const GrDeviceCoordTexture* dstCopy,
+ GrGpu::DrawType drawType) {
+
+ fDrawType = drawType;
+
// Create XferProcessor from DS's XPFactory
SkAutoTUnref<GrXferProcessor> xferProcessor(
drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI));

Powered by Google App Engine
This is Rietveld 408576698