OSDN Git Service

Split assets atlas batches
authorRomain Guy <romainguy@google.com>
Tue, 6 Aug 2013 20:49:28 +0000 (13:49 -0700)
committerRomain Guy <romainguy@google.com>
Wed, 7 Aug 2013 01:35:01 +0000 (18:35 -0700)
commit7f6d6b0370df4b5a9e0f45bffc31ea6caeeb509d
tree00e4cbd5c4b2f7e27d4c4f42ea05bdee576a0766
parent605ca203782781aa023b5b2963edbf2966379c45
Split assets atlas batches
Bug #10185769

The assets atlas contains assets that need to be blended and assets
that do not need to be blended. With a single merge id, currently
set to be the pointer to the atlas itself, draw ops merging could
generate batches of commands containing both opaque and translucent
assets. The blend state was chosen from only one of the assets in
the batch, leading either to inefficiencies (blending large opaque
assets) or incorrect behaviors (not blending translucent assets.)

This change introduces two new merge ids in the atlas: an opaque
key and a blend key. These keys are simple booleans set to false
and true respectively (the values do not matter really.) Their
memory addresses are used as the merge ids when createing draw ops
batches, allowing all opaque ops to be batched together and all
translucent ops to be batched together.

Change-Id: I114dba0533c44987e53864b471ccb28c811f2025
libs/hwui/AssetAtlas.cpp
libs/hwui/AssetAtlas.h
libs/hwui/DeferredDisplayList.h
libs/hwui/DisplayListOp.h