diff options
author | 2015-09-09 09:48:06 -0700 | |
---|---|---|
committer | 2015-09-09 09:48:06 -0700 | |
commit | 1fcc01c4158bd68c679569e6c7cfbb302d0ce170 (patch) | |
tree | 2d3d41bf771e9433ed6a26b0e2e710f1c87a5391 /src/gpu/GrBufferedDrawTarget.h | |
parent | 5ca4fa3846067a47e88d35ace895df3ebe3ec2a5 (diff) |
GrPathRangeBatch
BUG=skia:
Review URL: https://codereview.chromium.org/1315563003
Diffstat (limited to 'src/gpu/GrBufferedDrawTarget.h')
-rw-r--r-- | src/gpu/GrBufferedDrawTarget.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/gpu/GrBufferedDrawTarget.h b/src/gpu/GrBufferedDrawTarget.h index 5a80a3ccfb..79b1a71cfe 100644 --- a/src/gpu/GrBufferedDrawTarget.h +++ b/src/gpu/GrBufferedDrawTarget.h @@ -20,7 +20,6 @@ */ class GrBufferedDrawTarget : public GrClipTarget { public: - /** * Creates a GrBufferedDrawTarget * @@ -31,82 +30,14 @@ public: ~GrBufferedDrawTarget() override; protected: - void appendIndicesAndTransforms(const void* indexValues, PathIndexType indexType, - const float* transformValues, PathTransformType transformType, - int count, char** indicesLocation, float** xformsLocation) { - int indexBytes = GrPathRange::PathIndexSizeInBytes(indexType); - *indicesLocation = (char*) fPathIndexBuffer.alloc(count * indexBytes, - SkChunkAlloc::kThrow_AllocFailType); - SkASSERT(SkIsAlign4((uintptr_t)*indicesLocation)); - memcpy(*indicesLocation, reinterpret_cast<const char*>(indexValues), count * indexBytes); - - const int xformBytes = GrPathRendering::PathTransformSize(transformType) * sizeof(float); - *xformsLocation = nullptr; - - if (0 != xformBytes) { - *xformsLocation = (float*) fPathTransformBuffer.alloc(count * xformBytes, - SkChunkAlloc::kThrow_AllocFailType); - SkASSERT(SkIsAlign4((uintptr_t)*xformsLocation)); - memcpy(*xformsLocation, transformValues, count * xformBytes); - } - } - void onDrawBatch(GrBatch*) override; private: - friend class GrInOrderCommandBuilder; - friend class GrTargetCommands; - - typedef GrTargetCommands::StateForPathDraw StateForPathDraw; - - StateForPathDraw* allocState(const GrPrimitiveProcessor* primProc = nullptr) { - void* allocation = fPipelineBuffer.alloc(sizeof(StateForPathDraw), - SkChunkAlloc::kThrow_AllocFailType); - return new (allocation) StateForPathDraw(primProc); - } - - void unallocState(StateForPathDraw* state) { - state->unref(); - fPipelineBuffer.unalloc(state); - } - void onReset() override; void onFlush() override; - void onDrawPaths(const GrPathProcessor*, - const GrPathRange*, - const void* indices, - PathIndexType, - const float transformValues[], - PathTransformType, - int count, - const GrStencilSettings&, - const PipelineInfo&) override; - - bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } - - StateForPathDraw* SK_WARN_UNUSED_RESULT createStateForPathDraw( - const GrPrimitiveProcessor*, - const PipelineInfo&, - GrPipelineOptimizations* opts); - - // TODO: Use a single allocator for commands and records - enum { - kPathIdxBufferMinReserve = 2 * 64, // 64 uint16_t's - kPathXformBufferMinReserve = 2 * 64, // 64 two-float transforms - kPipelineBufferMinReserve = 32 * sizeof(StateForPathDraw), - }; - - // every 100 flushes we should reset our fPipelineBuffer to prevent us from holding at a - // highwater mark - static const int kPipelineBufferHighWaterMark = 100; - SkAutoTDelete<GrCommandBuilder> fCommands; - SkChunkAlloc fPathIndexBuffer; - SkChunkAlloc fPathTransformBuffer; - SkChunkAlloc fPipelineBuffer; uint32_t fDrawID; - SkAutoTUnref<StateForPathDraw> fPrevState; typedef GrClipTarget INHERITED; }; |