diff options
author | dcheng <dcheng@chromium.org> | 2014-09-27 00:33:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-27 07:33:30 +0000 |
commit | 78d5331bcd375f8c8f0285d648dc30cc4f206367 (patch) | |
tree | afc3c9100269d4dab67803ed9650f4a4d6baba23 /cc/layers/tiled_layer.cc | |
parent | 67f01ddf1bc44927cbe10bcc000bf8eec462c1fc (diff) | |
download | chromium_src-78d5331bcd375f8c8f0285d648dc30cc4f206367.zip chromium_src-78d5331bcd375f8c8f0285d648dc30cc4f206367.tar.gz chromium_src-78d5331bcd375f8c8f0285d648dc30cc4f206367.tar.bz2 |
Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (patchset #6 id:120001 of https://codereview.chromium.org/609663003/)
Reason for revert:
scoped_ptr nullptr support needs to be reverted
Original issue's description:
> cc: Remove use of PassAs() and constructor-casting with scoped_ptr.
>
> Say you have class A and subclass B.
>
> Previously it was required to PassAs() a scoped_ptr<B> into a
> scoped_ptr<A>. This is no longer needed, so just use Pass(). For newly
> created scoped_ptrs, you can just use make_scoped_ptr always now.
>
> And when you want to return or assign an empty scoped_ptr(), you can
> now use nullptr directly.
>
> Also adds PRESUBMIT checks for:
> - return scoped<T>(foo). This should be return make_scoped_ptr(foo).
> - bar = scoped<T>(foo). This should be return bar = make_scoped_ptr(foo).
> - return scoped<T>(). This should be return nullptr.
> - bar = scoped<T>(). This should be return bar = nullptr.
>
> This also replaces p.reset() with p = nullptr; But it does not add a
> PRESUBMIT check for that because there are things other than scoped_ptr
> with a reset() function.
>
> R=enne@chromium.org
>
> Committed: https://crrev.com/7bb3dbede19d87f0338797756ffd738adc6bca08
> Cr-Commit-Position: refs/heads/master@{#297096}
TBR=enne@chromium.org,jamesr@chromium.org,vmpstr@chromium.org,danakj@chromium.org
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/608503005
Cr-Commit-Position: refs/heads/master@{#297106}
Diffstat (limited to 'cc/layers/tiled_layer.cc')
-rw-r--r-- | cc/layers/tiled_layer.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc index 854a747..1f30b45 100644 --- a/cc/layers/tiled_layer.cc +++ b/cc/layers/tiled_layer.cc @@ -98,7 +98,7 @@ TiledLayer::TiledLayer() TiledLayer::~TiledLayer() {} scoped_ptr<LayerImpl> TiledLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { - return TiledLayerImpl::Create(tree_impl, id()); + return TiledLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); } void TiledLayer::UpdateTileSizeAndTilingOption() { @@ -277,7 +277,7 @@ UpdatableTile* TiledLayer::CreateTile(int i, int j) { tile->managed_resource()->SetDimensions(tiler_->tile_size(), texture_format_); UpdatableTile* added_tile = tile.get(); - tiler_->AddTile(tile.Pass(), i, j); + tiler_->AddTile(tile.PassAs<LayerTilingData::Tile>(), i, j); added_tile->dirty_rect = tiler_->TileRect(added_tile); |