aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-01-22 06:48:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 06:48:46 -0800
commit7df3f5e127f8016d17b637cc48a6a4718f1a6822 (patch)
tree224a919d0ed775835fb6dd40ddb2399214de081e /src/gpu/GrDrawTarget.cpp
parent7481e75830dfae1e9084ff62e3d8438879e31aaa (diff)
added support for PLS path rendering
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index e2e188eb12..b9dc794526 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -20,6 +20,7 @@
#include "GrSurfacePriv.h"
#include "GrTexture.h"
#include "GrVertexBuffer.h"
+#include "gl/GrGLRenderTarget.h"
#include "SkStrokeRec.h"
@@ -212,6 +213,8 @@ void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) {
}
fBatches[i]->draw(flushState);
}
+
+ fGpu->performFlushWorkaround();
}
void GrDrawTarget::reset() {
@@ -487,6 +490,31 @@ bool GrDrawTarget::installPipelineInDrawBatch(const GrPipelineBuilder* pipelineB
args.fCaps = this->caps();
args.fScissor = scissor;
batch->getPipelineOptimizations(&args.fOpts);
+ GrScissorState finalScissor;
+ if (args.fOpts.fOverrides.fUsePLSDstRead) {
+ GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+ GrGLIRect viewport;
+ viewport.fLeft = 0;
+ viewport.fBottom = 0;
+ viewport.fWidth = rt->width();
+ viewport.fHeight = rt->height();
+ SkIRect ibounds;
+ ibounds.fLeft = SkTPin(SkScalarFloorToInt(batch->bounds().fLeft), viewport.fLeft,
+ viewport.fWidth);
+ ibounds.fTop = SkTPin(SkScalarFloorToInt(batch->bounds().fTop), viewport.fBottom,
+ viewport.fHeight);
+ ibounds.fRight = SkTPin(SkScalarCeilToInt(batch->bounds().fRight), viewport.fLeft,
+ viewport.fWidth);
+ ibounds.fBottom = SkTPin(SkScalarCeilToInt(batch->bounds().fBottom), viewport.fBottom,
+ viewport.fHeight);
+ if (scissor != nullptr && scissor->enabled()) {
+ if (!ibounds.intersect(scissor->rect())) {
+ ibounds = scissor->rect();
+ }
+ }
+ finalScissor.set(ibounds);
+ args.fScissor = &finalScissor;
+ }
args.fOpts.fColorPOI.completeCalculations(pipelineBuilder->fColorFragmentProcessors.begin(),
pipelineBuilder->numColorFragmentProcessors());
args.fOpts.fCoveragePOI.completeCalculations(