diff options
author | 2017-04-26 14:55:34 -0400 | |
---|---|---|
committer | 2017-04-26 19:28:19 +0000 | |
commit | f6d7eb158e4148fb26349b12f4b7f7fd4d96e563 (patch) | |
tree | b1a7026e1c2e036b91afdd7b514f7e5c560358f9 | |
parent | 67e617149df4336b77a3ccdf5ea7d557c7a33166 (diff) |
Remove pre-allocated clip space from GrRenderTargetOpList
It seems like this should be safe (perf-regression-wise) since the arena allocated clips are used infrequently.
In the following, each GM run has 621 srcs and a total of 81087 ops.
Each skp run has 87 srcs and a total of 14709 ops.
The following table shows how many times the arena allocator is called for each config/src.
Overall, I think is safe to only allocate the arena-allocated space on an as needed basis.
gl-gm: 0
gl-skp: 0
gl-msaa4: 0
gl-msaa4: 0
glinst-gm: 1225
glinst-skp: 579
glnvpr4-gm: 623
glnvpr4-skp: 77
Change-Id: I78e04b060b6ad3b78697519249bb4b9c3193fc85
Reviewed-on: https://skia-review.googlesource.com/14392
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
-rw-r--r-- | src/gpu/GrRenderTargetOpList.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrRenderTargetOpList.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index 3abc21c131..5c81a92ab3 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -28,9 +28,7 @@ static const int kMaxOpLookahead = 10; GrRenderTargetOpList::GrRenderTargetOpList(sk_sp<GrRenderTargetProxy> proxy, GrGpu* gpu, GrAuditTrail* auditTrail) : INHERITED(std::move(proxy), auditTrail) - , fLastClipStackGenID(SK_InvalidUniqueID) - , fClipAllocator(fClipAllocatorStorage, sizeof(fClipAllocatorStorage), - sizeof(fClipAllocatorStorage)) { + , fLastClipStackGenID(SK_InvalidUniqueID) { if (GrCaps::InstancedSupport::kNone != gpu->caps()->instancedSupport()) { fInstancedRendering.reset(gpu->createInstancedRendering()); } diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h index 4b3f0d0659..342f9278d5 100644 --- a/src/gpu/GrRenderTargetOpList.h +++ b/src/gpu/GrRenderTargetOpList.h @@ -150,8 +150,9 @@ private: SkSTArray<256, RecordedOp, true> fRecordedOps; - char fClipAllocatorStorage[4096]; - SkArenaAlloc fClipAllocator; + // MDB TODO: 4096 for the first allocation of the clip space will be huge overkill. + // Gather statistics to determine the correct size. + SkArenaAlloc fClipAllocator{4096}; typedef GrOpList INHERITED; }; |