aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-08 18:05:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-08 22:32:02 +0000
commit802cb318f695d5c3ade20b6424c97ea548a929b2 (patch)
tree964cb86d42d1d3e0e2ffb970364622b902733a44 /src/gpu/gl/GrGLGpu.h
parent65b7bfcf61c5d925bf0066a2b40dd6ef7cf82595 (diff)
Stop passing GrPrimitiveProcessor to GrMesh::sendToGpu.
It is currently used in GrGLGpu::setupGeometry. Instead: 1) Make GrMesh track whether primitive restart should be enabled. 2) Make GrGLProgram track program attributes. Change-Id: Ice411a495961fcbc3cedc81e8ae0583537f42153 Reviewed-on: https://skia-review.googlesource.com/132267 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r--src/gpu/gl/GrGLGpu.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 7240f9d763..48cd21b426 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -95,24 +95,22 @@ public:
// GrMesh::SendToGpuImpl methods. These issue the actual GL draw calls.
// Marked final as a hint to the compiler to not use virtual dispatch.
- void sendMeshToGpu(const GrPrimitiveProcessor&, GrPrimitiveType,
- const GrBuffer* vertexBuffer, int vertexCount, int baseVertex) final;
+ void sendMeshToGpu(GrPrimitiveType, const GrBuffer* vertexBuffer, int vertexCount,
+ int baseVertex) final;
- void sendIndexedMeshToGpu(const GrPrimitiveProcessor&, GrPrimitiveType,
- const GrBuffer* indexBuffer, int indexCount, int baseIndex,
- uint16_t minIndexValue, uint16_t maxIndexValue,
- const GrBuffer* vertexBuffer, int baseVertex) final;
+ void sendIndexedMeshToGpu(GrPrimitiveType, const GrBuffer* indexBuffer, int indexCount,
+ int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue,
+ const GrBuffer* vertexBuffer, int baseVertex,
+ GrPrimitiveRestart) final;
- void sendInstancedMeshToGpu(const GrPrimitiveProcessor&, GrPrimitiveType,
- const GrBuffer* vertexBuffer, int vertexCount, int baseVertex,
- const GrBuffer* instanceBuffer, int instanceCount,
+ void sendInstancedMeshToGpu(GrPrimitiveType, const GrBuffer* vertexBuffer, int vertexCount,
+ int baseVertex, const GrBuffer* instanceBuffer, int instanceCount,
int baseInstance) final;
- void sendIndexedInstancedMeshToGpu(const GrPrimitiveProcessor&, GrPrimitiveType,
- const GrBuffer* indexBuffer, int indexCount, int baseIndex,
- const GrBuffer* vertexBuffer, int baseVertex,
+ void sendIndexedInstancedMeshToGpu(GrPrimitiveType, const GrBuffer* indexBuffer, int indexCount,
+ int baseIndex, const GrBuffer* vertexBuffer, int baseVertex,
const GrBuffer* instanceBuffer, int instanceCount,
- int baseInstance) final;
+ int baseInstance, GrPrimitiveRestart) final;
// The GrGLGpuRTCommandBuffer does not buffer up draws before submitting them to the gpu.
// Thus this is the implementation of the clear call for the corresponding passthrough function
@@ -260,13 +258,18 @@ private:
// willDrawPoints must be true if point primitives will be rendered after setting the GL state.
bool flushGLState(const GrPipeline&, const GrPrimitiveProcessor&, bool willDrawPoints);
+ void flushProgram(sk_sp<GrGLProgram>);
+
+ // Version for programs that aren't GrGLProgram.
+ void flushProgram(GrGLuint);
+
// Sets up vertex/instance attribute pointers and strides.
- void setupGeometry(const GrPrimitiveProcessor&,
- const GrBuffer* indexBuffer,
+ void setupGeometry(const GrBuffer* indexBuffer,
const GrBuffer* vertexBuffer,
int baseVertex,
const GrBuffer* instanceBuffer,
- int baseInstance);
+ int baseInstance,
+ GrPrimitiveRestart);
void flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSwizzle&);
@@ -408,7 +411,9 @@ private:
///@name Caching of GL State
///@{
int fHWActiveTextureUnitIdx;
+
GrGLuint fHWProgramID;
+ sk_sp<GrGLProgram> fHWProgram;
enum TriState {
kNo_TriState,