Commit afc2fea9 authored by yiyix's avatar yiyix Committed by Commit Bot

Optimize Draw Occlusion algorithm

This patch is aimed to reduce the running time of draw occlusion algorithm.
In draw occlusion, quad++ is used to increase the iterator pointer to
visit the next draw quad. In reality, the quad++ calls
cc::ListContainer::Iterator::operator++ and creates a new Iterator which
points at the next draw quad. As a result, quad++ is always the top 3
expensive line in draw occlusion.

BEFORE:
91.61% viz::Display::RemoveOverdrawQuads(CompositorFrame)
  32.21% cc::ListContainer::viz::DrawQuad::Iterator
  29.26% cc::ListContainer::viz::SharedQuadState::end
  7.42% cc::ListContainerHelper::PositionInCharAllocator
  4.40% cc::ListContainer::viz::SharedQuadState::begin
  4.23% gfx::Transform(SkMatrix44)
  1.59% cc::ListContainer::viz::SharedQuadState::Iterator


AFTER:
91.51% viz::Display::RemoveOverdrawQuads(CompositorFrame)
 83.37% viz::Display::RemoveOverdrawQuads(CompositorFrame)
   32.04% cc::ListContainer::viz::SharedQuadState::end
   29.08% cc::ListContainer::viz::SharedQuadState::ConstIterator
   7.54% cc::ListContainerHelper::PositionInCharAllocator
   4.75% cc::ListContainer::viz::SharedQuadState::begin
   4.35% gfx::Transform(SkMatrix44)
   0.99% cc::ListContainer::viz::SharedQuadState::ReverseIterator

ref: https://docs.google.com/document/d/1gM4h1ca2jDWdXbYa9yjC53m0sJzaT9skqbPGnfDsdyI
Bug: 672929
Change-Id: I377ab3af3fdfa7e3d7ceb42dcfc2056de149424d
Reviewed-on: https://chromium-review.googlesource.com/782063
Commit-Queue: Yi Xu <yiyix@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518358}
parent bb569a38
......@@ -576,7 +576,7 @@ void Display::RemoveOverdrawQuads(CompositorFrame* frame) {
}
if (!current_sqs_intersects_occlusion) {
quad++;
++quad;
continue;
}
......@@ -586,7 +586,7 @@ void Display::RemoveOverdrawQuads(CompositorFrame* frame) {
transform, quad->visible_rect)))
quad = pass->quad_list.EraseAndInvalidateAllPointers(quad);
else
quad++;
++quad;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment