diff options
author | egdaniel <egdaniel@google.com> | 2016-07-28 08:53:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-28 08:53:07 -0700 |
commit | b4021cfd6630dccc95ee1d4124cad41c79103129 (patch) | |
tree | ea5659d2084c055c7c5a956d159912d2d9141289 /src | |
parent | 92772222bf548acf937761eb5150d5bb8e4a7bc4 (diff) |
Don't call finish on GrDrawTarget if we drew no batches
This might give us some minor perf gains in vulkan since we won't be submitting
command buffers that we've added to batch draws to. Running nanobench this does
seem to happen pretty often.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2179903008
Review-Url: https://codereview.chromium.org/2179903008
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index d03130d18e..717cd5d1bb 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -216,6 +216,9 @@ void GrDrawTarget::prepareBatches(GrBatchFlushState* flushState) { } void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) { + if (0 == fRecordedBatches.count()) { + return; + } // Draw all the generated geometry. SkRandom random; GrRenderTarget* currentRT = nullptr; |