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

Unified Diff: src/gpu/batches/GrDrawPathBatch.cpp

Issue 1966763002: Eliminate special case nvpr batch handling (Closed) Base URL: https://skia.googlesource.com/skia.git@reallyupload_userstencil
Patch Set: fixes Created 4 years, 7 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
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.cpp
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index 1395d083286c7482a9c85bd5c0ef63adc81a0aca..751ddda4eae9f47f8f0350dc67c9083485d5b968 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -7,10 +7,18 @@
#include "GrDrawPathBatch.h"
+#include "GrRenderTargetPriv.h"
+
static void pre_translate_transform_values(const float* xforms,
GrPathRendering::PathTransformType type, int count,
SkScalar x, SkScalar y, float* dst);
+void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) {
+ const GrRenderTargetPriv& rtPriv = this->pipeline()->getRenderTarget()->renderTargetPriv();
+ fStencilPassSettings.reset(GrPathRendering::GetStencilPassSettings(fFillType),
+ this->pipeline()->hasStencilClip(), rtPriv.numStencilBits());
+}
+
SkString GrDrawPathBatch::dumpInfo() const {
SkString string;
string.printf("PATH: 0x%p", fPath.get());
@@ -23,8 +31,8 @@ void GrDrawPathBatch::onDraw(GrBatchFlushState* state) {
SkAutoTUnref<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
this->overrides(),
this->viewMatrix()));
- state->gpu()->pathRendering()->drawPath(*this->pipeline(), *pathProc, this->stencilSettings(),
- fPath.get());
+ state->gpu()->pathRendering()->drawPath(*this->pipeline(), *pathProc,
+ this->stencilPassSettings(), fPath.get());
}
SkString GrDrawPathRangeBatch::dumpInfo() const {
@@ -89,7 +97,7 @@ bool GrDrawPathRangeBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
// numbers, and we only partially account for this by not allowing even/odd paths to be
// combined. (Glyphs in the same font tend to wind the same direction so it works out OK.)
if (GrPathRendering::kWinding_FillType != this->fillType() ||
- this->stencilSettings() != that->stencilSettings() ||
+ GrPathRendering::kWinding_FillType != that->fillType() ||
this->overrides().willColorBlendWithDst()) {
return false;
}
@@ -126,7 +134,7 @@ void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) {
const InstanceData& instances = *head.fInstanceData;
state->gpu()->pathRendering()->drawPaths(*this->pipeline(),
*pathProc,
- this->stencilSettings(),
+ this->stencilPassSettings(),
fPathRange.get(),
instances.indices(),
GrPathRange::kU16_PathIndexType,
@@ -155,7 +163,7 @@ void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) {
state->gpu()->pathRendering()->drawPaths(*this->pipeline(),
*pathProc,
- this->stencilSettings(),
+ this->stencilPassSettings(),
fPathRange.get(),
indexStorage,
GrPathRange::kU16_PathIndexType,
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698