Skip to content

Commit d10f080

Browse files
csmartdalton86Skia Commit-Bot
authored and
Skia Commit-Bot
committed
Return the actual block capacity from GrBufferAllocPool::makeSpaceAtLeast
It looks like this was changed to return the fallback size instead of the block capacity for the sake of GrTextureOp, but GrTextureOp does not call makeSpaceAtLeast() anymore. For ops that write their vertex data in chunks, it's best to know the full capacity of the block. This way they can maximize the amount of data written out per chunk. Bug: skia:10419 Change-Id: I7d3f74cdfc7d9b89f9d331e09069f8d178c07d81 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300396 Reviewed-by: Brian Salomon <[email protected]> Commit-Queue: Chris Dalton <[email protected]>
1 parent c8b721b commit d10f080

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/gpu/GrBufferAllocPool.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,8 @@ void* GrBufferAllocPool::makeSpaceAtLeast(size_t minSize,
261261
back.fBytesFree -= pad;
262262
fBytesInUse += pad;
263263

264-
// Give caller all remaining space in this block up to fallbackSize (but aligned
265-
// correctly)
266-
size_t size;
267-
if (back.fBytesFree >= fallbackSize) {
268-
SkASSERT(align_down(fallbackSize, alignment) == fallbackSize);
269-
size = fallbackSize;
270-
} else {
271-
size = align_down(back.fBytesFree, alignment);
272-
}
264+
// Give caller all remaining space in this block (but aligned correctly)
265+
size_t size = align_down(back.fBytesFree, alignment);
273266
*offset = usedBytes;
274267
*buffer = back.fBuffer;
275268
*actualSize = size;

0 commit comments

Comments
 (0)