Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index a6792aa42aea393a77081062663194124817020b..a04549a19b340095349aacdda6eaa3e8b459669a 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -69,8 +69,6 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, |
| : LayerImpl(tree_impl, id), |
| twin_layer_(nullptr), |
| tilings_(CreatePictureLayerTilingSet()), |
| - // TODO(danakj): Can this be null to start? |
| - raster_source_(PicturePileImpl::Create()), |
| ideal_page_scale_(0.f), |
| ideal_device_scale_(0.f), |
| ideal_source_scale_(0.f), |
| @@ -580,7 +578,9 @@ void PictureLayerImpl::UpdateRasterSource( |
| << " bounds " << bounds().ToString() << " pile " |
| << raster_source->GetSize().ToString(); |
| - bool could_have_tilings = CanHaveTilings(); |
| + // The |raster_source_| is initially null, so have to check for that for the |
| + // first frame. |
| + bool could_have_tilings = raster_source_.get() && CanHaveTilings(); |
|
vmpstr
2014/12/15 22:16:25
nit: It would be cleaner, albeit slower, if this c
danakj
2014/12/15 22:22:31
I think I prefer it here, I want to be clear that
|
| raster_source_.swap(raster_source); |
| // The |new_invalidation| must be cleared before updating tilings since they |