Return NULL when building empty LayerRasterizer.
authorscroggo <scroggo@google.com>
Tue, 3 Jun 2014 20:12:51 +0000 (13:12 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 3 Jun 2014 20:12:51 +0000 (13:12 -0700)
commit65044bfe021e9c0023d78080583e9acb3bdb5ce7
tree79345f8bd3f3933cd1944745396558caa7b043a5
parent99ffe24200d8940ceba20f6fbf8c460f994d3cd1
Return NULL when building empty LayerRasterizer.

In SkLayerRasterizer::snapshotRasterizer() and ::detachRasterizer(),
if no layers have been added, do not attempt to create an
SkLayerRasterizer. Instead, return NULL.

This fixes an error when running tests on Android.

Update dox to state that NULL may be returned.

Add tests.

R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/313653006
include/effects/SkLayerRasterizer.h
src/effects/SkLayerRasterizer.cpp
tests/LayerRasterizerTest.cpp