Refactor GrLayerCache for new API
authorrobertphillips <robertphillips@google.com>
Mon, 18 Aug 2014 15:50:03 +0000 (08:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 18 Aug 2014 15:50:03 +0000 (08:50 -0700)
commit6f294af43bcd94ed9616a7e4f5892589813d0a01
tree0be9696ceeb7c5ad6a160fe58aa1c1b6d15772a6
parent479601b9a74b5b8e424ed3d68882e161617bdceb
Refactor GrLayerCache for new API

The only substantive change in this CL is skipping atlasing
for any layers that are involved in nesting. Prior versions
have allowed nesting layers to be atlased.

--------------------------------------------------------

All times are on Windows with a repeat count of 200.
Format is: <time in ms> (<# of glBindframebuffer calls>)

How to interpret this:

For the boogie page:

 both columns should be the same (since boogie has no
        nested layers)
 without the new API the tiled case doesn't show any real
        benefit from hoisting

For the carsvg page:

 The nesting change does increase the number of FBO
      switches but doesn't kill performance
 Because of the location & size of the layers the
      tile case does show some improvement (even
      without the new API)

boogie
-------

   w/o nested change   w/ nested change

simple                5.62 (811)           N/A

tiled                 7.72 (811)           N/A

simple w/ hoisting    5.23 (409)        5.77 (409)
(but no caching)

tiled w/ hoisting     7.57 (809)        7.49 (809)
(but no caching)

carsvg
------

   w/o nested change   w/ nested change

simple        60.37 (141990)        N/A

tiled                115.13 (256929)        N/A

simple w/ hoisting    41.57 (64570)      42.82 (72279)
(but no caching)

tiled w/ hoisting     84.24 (154352)     84.71 (165630)
(but no caching)

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/476833004
src/gpu/GrLayerCache.cpp
src/gpu/GrLayerCache.h
src/gpu/SkGpuDevice.cpp
tests/GpuLayerCacheTest.cpp