aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp9
-rw-r--r--src/gpu/gl/GrGLGpu.h3
-rw-r--r--src/gpu/gl/GrGLGpuCommandBuffer.h5
3 files changed, 14 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index b6c807656f..50c0edba45 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2449,6 +2449,7 @@ GrGLenum gPrimitiveType2GLMode[] = {
void GrGLGpu::draw(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
const GrMesh meshes[],
+ const GrPipeline::DynamicState dynamicStates[],
int meshCount) {
this->handleDirtyContext();
@@ -2468,6 +2469,14 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
this->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
+ if (dynamicStates) {
+ if (pipeline.getScissorState().enabled()) {
+ GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget());
+ this->flushScissor(dynamicStates[i].fScissorRect,
+ glRT->getViewport(), glRT->origin());
+ }
+ }
+
meshes[i].sendToGpu(primProc, this);
}
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 1785eae143..639b589f50 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -101,7 +101,8 @@ public:
// on GrGLGpuCommandBuffer.
void draw(const GrPipeline&,
const GrPrimitiveProcessor&,
- const GrMesh*,
+ const GrMesh[],
+ const GrPipeline::DynamicState[],
int meshCount);
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h
index c7c76a4a9c..c6e7208f4c 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.h
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.h
@@ -49,7 +49,8 @@ private:
void onDraw(const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
- const GrMesh* mesh,
+ const GrMesh mesh[],
+ const GrPipeline::DynamicState dynamicStates[],
int meshCount,
const SkRect& bounds) override {
GrGLRenderTarget* target = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget());
@@ -57,7 +58,7 @@ private:
fRenderTarget = target;
}
SkASSERT(target == fRenderTarget);
- fGpu->draw(pipeline, primProc, mesh, meshCount);
+ fGpu->draw(pipeline, primProc, mesh, dynamicStates, meshCount);
}
void onClear(GrRenderTarget* rt, const GrFixedClip& clip, GrColor color) override {