summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-09-26 19:39:25 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-27 02:39:41 +0000
commit7bb3dbede19d87f0338797756ffd738adc6bca08 (patch)
treeecd66a8fe850e5c57833a673fb39c41dbe27ffeb /cc/trees
parenta60566701028a7344d17826076780eeb84b63052 (diff)
downloadchromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.zip
chromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.tar.gz
chromium_src-7bb3dbede19d87f0338797756ffd738adc6bca08.tar.bz2
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 Review URL: https://codereview.chromium.org/609663003 Cr-Commit-Position: refs/heads/master@{#297096}
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host.cc4
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc6
-rw-r--r--cc/trees/layer_tree_host_impl.cc38
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc118
-rw-r--r--cc/trees/layer_tree_host_unittest.cc26
-rw-r--r--cc/trees/layer_tree_host_unittest_animation.cc4
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc24
-rw-r--r--cc/trees/layer_tree_host_unittest_copyrequest.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_no_message_loop.cc4
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc2
-rw-r--r--cc/trees/layer_tree_impl.cc24
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc5
-rw-r--r--cc/trees/occlusion_tracker_perftest.cc7
-rw-r--r--cc/trees/occlusion_tracker_unittest.cc18
-rw-r--r--cc/trees/single_thread_proxy.cc7
-rw-r--r--cc/trees/thread_proxy.cc13
-rw-r--r--cc/trees/tree_synchronizer.cc2
-rw-r--r--cc/trees/tree_synchronizer_unittest.cc2
18 files changed, 136 insertions, 170 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 78373c7..6b86eb6 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -166,7 +166,7 @@ LayerTreeHost::~LayerTreeHost() {
BreakSwapPromises(SwapPromise::COMMIT_FAILS);
- overhang_ui_resource_.reset();
+ overhang_ui_resource_ = nullptr;
if (root_layer_.get())
root_layer_->SetLayerTreeHost(NULL);
@@ -366,7 +366,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
pending_page_scale_animation_->use_anchor,
pending_page_scale_animation_->scale,
pending_page_scale_animation_->duration);
- pending_page_scale_animation_.reset();
+ pending_page_scale_animation_ = nullptr;
}
if (!ui_resource_request_queue_.empty()) {
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 1efc110..82e34fa 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -7852,9 +7852,9 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
AnimationScaleFactorTrackingLayerImpl* child_raw = child.get();
AnimationScaleFactorTrackingLayerImpl* grand_child_raw = grand_child.get();
- child->AddChild(grand_child.PassAs<LayerImpl>());
- parent->AddChild(child.PassAs<LayerImpl>());
- grand_parent->AddChild(parent.PassAs<LayerImpl>());
+ child->AddChild(grand_child.Pass());
+ parent->AddChild(child.Pass());
+ grand_parent->AddChild(parent.Pass());
SetLayerPropertiesForTesting(grand_parent.get(),
identity_matrix,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 29e29c3..5771bbb 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -309,9 +309,9 @@ LayerTreeHostImpl::~LayerTreeHostImpl() {
if (pending_tree_)
pending_tree_->Shutdown();
active_tree_->Shutdown();
- recycle_tree_.reset();
- pending_tree_.reset();
- active_tree_.reset();
+ recycle_tree_ = nullptr;
+ pending_tree_ = nullptr;
+ active_tree_ = nullptr;
DestroyTileManager();
}
@@ -446,7 +446,7 @@ void LayerTreeHostImpl::StartPageScaleAnimation(
// Easing constants experimentally determined.
scoped_ptr<TimingFunction> timing_function =
- CubicBezierTimingFunction::Create(.8, 0, .3, .9).PassAs<TimingFunction>();
+ CubicBezierTimingFunction::Create(.8, 0, .3, .9);
page_scale_animation_ =
PageScaleAnimation::Create(scroll_total,
@@ -506,7 +506,7 @@ bool LayerTreeHostImpl::HaveTouchEventHandlersAt(
scoped_ptr<SwapPromiseMonitor>
LayerTreeHostImpl::CreateLatencyInfoSwapPromiseMonitor(
ui::LatencyInfo* latency) {
- return scoped_ptr<SwapPromiseMonitor>(
+ return make_scoped_ptr(
new LatencyInfoSwapPromiseMonitor(latency, NULL, this));
}
@@ -1171,16 +1171,16 @@ void LayerTreeHostImpl::ResetTreesForTesting() {
active_tree_ = LayerTreeImpl::create(this);
if (pending_tree_)
pending_tree_->DetachLayerTree();
- pending_tree_.reset();
+ pending_tree_ = nullptr;
if (recycle_tree_)
recycle_tree_->DetachLayerTree();
- recycle_tree_.reset();
+ recycle_tree_ = nullptr;
}
void LayerTreeHostImpl::ResetRecycleTreeForTesting() {
if (recycle_tree_)
recycle_tree_->DetachLayerTree();
- recycle_tree_.reset();
+ recycle_tree_ = nullptr;
}
void LayerTreeHostImpl::EnforceManagedMemoryPolicy(
@@ -2041,10 +2041,10 @@ void LayerTreeHostImpl::CreateAndSetTileManager() {
}
void LayerTreeHostImpl::DestroyTileManager() {
- tile_manager_.reset();
- resource_pool_.reset();
- staging_resource_pool_.reset();
- raster_worker_pool_.reset();
+ tile_manager_ = nullptr;
+ resource_pool_ = nullptr;
+ staging_resource_pool_ = nullptr;
+ raster_worker_pool_ = nullptr;
}
bool LayerTreeHostImpl::UsePendingTreeForSync() const {
@@ -2077,10 +2077,10 @@ bool LayerTreeHostImpl::InitializeRenderer(
ReleaseTreeResources();
// Note: order is important here.
- renderer_.reset();
+ renderer_ = nullptr;
DestroyTileManager();
- resource_provider_.reset();
- output_surface_.reset();
+ resource_provider_ = nullptr;
+ output_surface_ = nullptr;
if (!output_surface->BindToClient(this))
return false;
@@ -2142,7 +2142,7 @@ void LayerTreeHostImpl::DeferredInitialize() {
DCHECK(output_surface_->context_provider());
ReleaseTreeResources();
- renderer_.reset();
+ renderer_ = nullptr;
DestroyTileManager();
resource_provider_->InitializeGL();
@@ -2160,7 +2160,7 @@ void LayerTreeHostImpl::ReleaseGL() {
DCHECK(output_surface_->context_provider());
ReleaseTreeResources();
- renderer_.reset();
+ renderer_ = nullptr;
DestroyTileManager();
resource_provider_->InitializeSoftware();
@@ -2428,7 +2428,7 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated(
curve->SetInitialValue(current_offset);
scoped_ptr<Animation> animation =
- Animation::Create(curve.PassAs<AnimationCurve>(),
+ Animation::Create(curve.Pass(),
AnimationIdProvider::NextAnimationId(),
AnimationIdProvider::NextGroupId(),
Animation::ScrollOffset);
@@ -2992,7 +2992,7 @@ void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) {
SetNeedsRedraw();
if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) {
- page_scale_animation_.reset();
+ page_scale_animation_ = nullptr;
client_->SetNeedsCommitOnImplThread();
client_->RenewTreePriority();
} else {
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 85e6a91..2607431 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -379,7 +379,7 @@ class LayerTreeHostImplTest : public testing::Test,
protected:
virtual scoped_ptr<OutputSurface> CreateOutputSurface() {
- return FakeOutputSurface::Create3d().PassAs<OutputSurface>();
+ return FakeOutputSurface::Create3d();
}
void DrawOneFrame() {
@@ -415,9 +415,8 @@ TEST_F(LayerTreeHostImplTest, NotifyIfCanDrawChanged) {
}
TEST_F(LayerTreeHostImplTest, CanDrawIncompleteFrames) {
- scoped_ptr<FakeOutputSurface> output_surface(
- FakeOutputSurface::CreateAlwaysDrawAndSwap3d());
- CreateHostImpl(DefaultSettings(), output_surface.PassAs<OutputSurface>());
+ CreateHostImpl(DefaultSettings(),
+ FakeOutputSurface::CreateAlwaysDrawAndSwap3d());
bool always_draw = true;
CheckNotifyCalledIfCanDrawChanged(always_draw);
@@ -527,12 +526,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
TestWebGraphicsContext3D::Create();
context_owned->set_context_lost(true);
- scoped_ptr<FakeOutputSurface> output_surface(FakeOutputSurface::Create3d(
- context_owned.Pass()));
-
// Initialization will fail.
- EXPECT_FALSE(CreateHostImpl(DefaultSettings(),
- output_surface.PassAs<OutputSurface>()));
+ EXPECT_FALSE(CreateHostImpl(
+ DefaultSettings(), FakeOutputSurface::Create3d(context_owned.Pass())));
SetupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -1329,7 +1325,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
scroll->AddChild(contents.Pass()); \
root->AddChild(scroll.Pass()); \
scrollbar->SetScrollLayerAndClipLayerByIds(2, 1); \
- root->AddChild(scrollbar.PassAs<LayerImpl>()); \
+ root->AddChild(scrollbar.Pass()); \
\
host_impl_->active_tree()->SetRootLayer(root.Pass()); \
host_impl_->active_tree()->SetViewportLayersFromIds( \
@@ -1497,7 +1493,7 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale(
scroll->AddChild(contents.Pass());
root->AddChild(scroll.Pass());
scrollbar->SetScrollLayerAndClipLayerByIds(2, 1);
- root->AddChild(scrollbar.PassAs<LayerImpl>());
+ root->AddChild(scrollbar.Pass());
host_impl_->active_tree()->SetRootLayer(root.Pass());
host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
@@ -1611,7 +1607,7 @@ TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) {
class DidDrawCheckLayer : public LayerImpl {
public:
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
- return scoped_ptr<LayerImpl>(new DidDrawCheckLayer(tree_impl, id));
+ return make_scoped_ptr(new DidDrawCheckLayer(tree_impl, id));
}
virtual bool WillDraw(DrawMode draw_mode, ResourceProvider* provider)
@@ -1837,13 +1833,12 @@ class MissingTextureAnimatingLayer : public DidDrawCheckLayer {
bool had_incomplete_tile,
bool animating,
ResourceProvider* resource_provider) {
- return scoped_ptr<LayerImpl>(
- new MissingTextureAnimatingLayer(tree_impl,
- id,
- tile_missing,
- had_incomplete_tile,
- animating,
- resource_provider));
+ return make_scoped_ptr(new MissingTextureAnimatingLayer(tree_impl,
+ id,
+ tile_missing,
+ had_incomplete_tile,
+ animating,
+ resource_provider));
}
virtual void AppendQuads(RenderPass* render_pass,
@@ -3640,9 +3635,8 @@ class BlendStateCheckLayer : public LayerImpl {
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl,
int id,
ResourceProvider* resource_provider) {
- return scoped_ptr<LayerImpl>(new BlendStateCheckLayer(tree_impl,
- id,
- resource_provider));
+ return make_scoped_ptr(
+ new BlendStateCheckLayer(tree_impl, id, resource_provider));
}
virtual void AppendQuads(RenderPass* render_pass,
@@ -3954,10 +3948,9 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest {
scoped_ptr<OutputSurface> CreateFakeOutputSurface(bool always_draw) {
if (always_draw) {
- return FakeOutputSurface::CreateAlwaysDrawAndSwap3d()
- .PassAs<OutputSurface>();
+ return FakeOutputSurface::CreateAlwaysDrawAndSwap3d();
}
- return FakeOutputSurface::Create3d().PassAs<OutputSurface>();
+ return FakeOutputSurface::Create3d();
}
void SetupActiveTreeLayers() {
@@ -4237,7 +4230,7 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ActiveTreeShrinkViewportInvalid) {
class FakeDrawableLayerImpl: public LayerImpl {
public:
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
- return scoped_ptr<LayerImpl>(new FakeDrawableLayerImpl(tree_impl, id));
+ return make_scoped_ptr(new FakeDrawableLayerImpl(tree_impl, id));
}
protected:
FakeDrawableLayerImpl(LayerTreeImpl* tree_impl, int id)
@@ -4407,7 +4400,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {
class FakeLayerWithQuads : public LayerImpl {
public:
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
- return scoped_ptr<LayerImpl>(new FakeLayerWithQuads(tree_impl, id));
+ return make_scoped_ptr(new FakeLayerWithQuads(tree_impl, id));
}
virtual void AppendQuads(RenderPass* render_pass,
@@ -4521,15 +4514,13 @@ class MockContextHarness {
TEST_F(LayerTreeHostImplTest, NoPartialSwap) {
scoped_ptr<MockContext> mock_context_owned(new MockContext);
MockContext* mock_context = mock_context_owned.get();
-
- scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d(
- mock_context_owned.PassAs<TestWebGraphicsContext3D>()));
MockContextHarness harness(mock_context);
// Run test case
LayerTreeSettings settings = DefaultSettings();
settings.partial_swap_enabled = false;
- CreateHostImpl(settings, output_surface.Pass());
+ CreateHostImpl(settings,
+ FakeOutputSurface::Create3d(mock_context_owned.Pass()));
SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
// Without partial swap, and no clipping, no scissor is set.
@@ -4560,13 +4551,11 @@ TEST_F(LayerTreeHostImplTest, NoPartialSwap) {
TEST_F(LayerTreeHostImplTest, PartialSwap) {
scoped_ptr<MockContext> context_owned(new MockContext);
MockContext* mock_context = context_owned.get();
- scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d(
- context_owned.PassAs<TestWebGraphicsContext3D>()));
MockContextHarness harness(mock_context);
LayerTreeSettings settings = DefaultSettings();
settings.partial_swap_enabled = true;
- CreateHostImpl(settings, output_surface.Pass());
+ CreateHostImpl(settings, FakeOutputSurface::Create3d(context_owned.Pass()));
SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
// The first frame is not a partially-swapped one.
@@ -4749,7 +4738,7 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
video_layer->SetBounds(gfx::Size(10, 10));
video_layer->SetContentBounds(gfx::Size(10, 10));
video_layer->SetDrawsContent(true);
- root_layer->AddChild(video_layer.PassAs<LayerImpl>());
+ root_layer->AddChild(video_layer.Pass());
scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
@@ -4757,7 +4746,7 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
io_surface_layer->SetContentBounds(gfx::Size(10, 10));
io_surface_layer->SetDrawsContent(true);
io_surface_layer->SetIOSurfaceProperties(1, gfx::Size(10, 10));
- root_layer->AddChild(io_surface_layer.PassAs<LayerImpl>());
+ root_layer->AddChild(io_surface_layer.Pass());
host_impl_->active_tree()->SetRootLayer(root_layer.Pass());
@@ -4792,13 +4781,11 @@ TEST_F(LayerTreeHostImplTest, HasTransparentBackground) {
new MockDrawQuadsToFillScreenContext);
MockDrawQuadsToFillScreenContext* mock_context = mock_context_owned.get();
- scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d(
- mock_context_owned.PassAs<TestWebGraphicsContext3D>()));
-
// Run test case
LayerTreeSettings settings = DefaultSettings();
settings.partial_swap_enabled = false;
- CreateHostImpl(settings, output_surface.Pass());
+ CreateHostImpl(settings,
+ FakeOutputSurface::Create3d(mock_context_owned.Pass()));
SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1));
host_impl_->active_tree()->set_background_color(SK_ColorWHITE);
@@ -4867,7 +4854,7 @@ class LayerTreeHostImplTestWithDelegatingRenderer
: public LayerTreeHostImplTest {
protected:
virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
- return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>();
+ return FakeOutputSurface::CreateDelegating3d();
}
void DrawFrameAndTestDamage(const gfx::RectF& expected_damage) {
@@ -4922,9 +4909,9 @@ TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
child->SetBounds(gfx::Size(1, 1));
child->SetContentBounds(gfx::Size(1, 1));
child->SetDrawsContent(true);
- root->AddChild(child.PassAs<LayerImpl>());
+ root->AddChild(child.Pass());
- host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
+ host_impl_->active_tree()->SetRootLayer(root.Pass());
// Draw a frame. In the first frame, the entire viewport should be damaged.
gfx::Rect full_frame_damage(host_impl_->DrawViewportSize());
@@ -4994,7 +4981,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) {
scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
- content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
+ content_layer->SetMaskLayer(scoped_mask_layer.Pass());
gfx::Size root_size(100, 100);
root->SetBounds(root_size);
@@ -5123,7 +5110,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) {
scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
- content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
+ content_layer->SetMaskLayer(scoped_mask_layer.Pass());
gfx::Size root_size(100, 100);
root->SetBounds(root_size);
@@ -5274,7 +5261,7 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerWithDifferentBounds) {
scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
- replica_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
+ replica_layer->SetMaskLayer(scoped_mask_layer.Pass());
gfx::Size root_size(100, 100);
root->SetBounds(root_size);
@@ -5426,7 +5413,7 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerForSurfaceWithUnclippedChild) {
scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
FakeMaskLayerImpl::Create(host_impl_->active_tree(), 5);
FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
- replica_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
+ replica_layer->SetMaskLayer(scoped_mask_layer.Pass());
gfx::Size root_size(100, 100);
root->SetBounds(root_size);
@@ -5546,7 +5533,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerForSurfaceWithClippedLayer) {
scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
FakeMaskLayerImpl::Create(host_impl_->active_tree(), 6);
FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
- content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
+ content_layer->SetMaskLayer(scoped_mask_layer.Pass());
gfx::Size root_size(100, 100);
root->SetBounds(root_size);
@@ -5647,7 +5634,7 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) {
scoped_ptr<FakePictureLayerImpl> scoped_content_layer =
FakePictureLayerImpl::CreateWithPile(host_impl_->pending_tree(), 3, pile);
LayerImpl* content_layer = scoped_content_layer.get();
- scrolling_layer->AddChild(scoped_content_layer.PassAs<LayerImpl>());
+ scrolling_layer->AddChild(scoped_content_layer.Pass());
content_layer->SetBounds(content_layer_bounds);
content_layer->SetDrawsContent(true);
@@ -5795,8 +5782,8 @@ TEST_F(LayerTreeHostImplTest,
video_layer->SetBounds(gfx::Size(10, 10));
video_layer->SetContentBounds(gfx::Size(10, 10));
video_layer->SetDrawsContent(true);
- root_layer->AddChild(video_layer.PassAs<LayerImpl>());
- SetupRootLayerImpl(root_layer.PassAs<LayerImpl>());
+ root_layer->AddChild(video_layer.Pass());
+ SetupRootLayerImpl(root_layer.Pass());
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
@@ -5821,12 +5808,11 @@ class LayerTreeHostImplTestDeferredInitialize : public LayerTreeHostImplTest {
delegated_rendering));
output_surface_ = output_surface.get();
- EXPECT_TRUE(CreateHostImpl(DefaultSettings(),
- output_surface.PassAs<OutputSurface>()));
+ EXPECT_TRUE(CreateHostImpl(DefaultSettings(), output_surface.Pass()));
scoped_ptr<SolidColorLayerImpl> root_layer =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
- SetupRootLayerImpl(root_layer.PassAs<LayerImpl>());
+ SetupRootLayerImpl(root_layer.Pass());
onscreen_context_provider_ = TestContextProvider::Create();
}
@@ -6024,7 +6010,7 @@ TEST_F(LayerTreeHostImplTest, UIResourceManagement) {
TestWebGraphicsContext3D::Create();
TestWebGraphicsContext3D* context3d = context.get();
scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d();
- CreateHostImpl(DefaultSettings(), output_surface.PassAs<OutputSurface>());
+ CreateHostImpl(DefaultSettings(), output_surface.Pass());
EXPECT_EQ(0u, context3d->NumTextures());
@@ -6068,8 +6054,7 @@ TEST_F(LayerTreeHostImplTest, CreateETC1UIResource) {
scoped_ptr<TestWebGraphicsContext3D> context =
TestWebGraphicsContext3D::Create();
TestWebGraphicsContext3D* context3d = context.get();
- scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::Create3d();
- CreateHostImpl(DefaultSettings(), output_surface.PassAs<OutputSurface>());
+ CreateHostImpl(DefaultSettings(), FakeOutputSurface::Create3d());
EXPECT_EQ(0u, context3d->NumTextures());
@@ -6098,9 +6083,8 @@ TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) {
scoped_refptr<TestContextProvider> context_provider =
TestContextProvider::Create();
- CreateHostImpl(
- DefaultSettings(),
- FakeOutputSurface::Create3d(context_provider).PassAs<OutputSurface>());
+ CreateHostImpl(DefaultSettings(),
+ FakeOutputSurface::Create3d(context_provider));
SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1));
@@ -6120,7 +6104,7 @@ TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) {
EXPECT_FALSE(context_provider->HasOneRef());
EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
- host_impl_.reset();
+ host_impl_ = nullptr;
// The CopyOutputResult's callback was cancelled, the CopyOutputResult
// released, and the texture deleted.
@@ -6452,7 +6436,7 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
root->SetContentBounds(gfx::Size(10, 10));
root->SetDrawsContent(true);
- host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
+ host_impl_->active_tree()->SetRootLayer(root.Pass());
FakeOutputSurface* fake_output_surface =
static_cast<FakeOutputSurface*>(host_impl_->output_surface());
@@ -6492,7 +6476,7 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) {
root->SetContentBounds(gfx::Size(10, 10));
root->SetDrawsContent(true);
- host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
+ host_impl_->active_tree()->SetRootLayer(root.Pass());
// Ensure the default frame selection bounds are empty.
FakeOutputSurface* fake_output_surface =
@@ -7126,7 +7110,7 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
FakePictureLayerImpl::Create(pending_tree, 10);
pending_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_pending_layer = pending_layer.get();
- pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>());
+ pending_tree->SetRootLayer(pending_layer.Pass());
ASSERT_EQ(raw_pending_layer, pending_tree->root_layer());
EXPECT_EQ(0u, raw_pending_layer->did_become_active_call_count());
@@ -7137,7 +7121,7 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
FakePictureLayerImpl::Create(pending_tree, 11);
mask_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_mask_layer = mask_layer.get();
- raw_pending_layer->SetMaskLayer(mask_layer.PassAs<LayerImpl>());
+ raw_pending_layer->SetMaskLayer(mask_layer.Pass());
ASSERT_EQ(raw_mask_layer, raw_pending_layer->mask_layer());
EXPECT_EQ(1u, raw_pending_layer->did_become_active_call_count());
@@ -7152,8 +7136,8 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
FakePictureLayerImpl::Create(pending_tree, 13);
replica_mask_layer->DoPostCommitInitializationIfNeeded();
FakePictureLayerImpl* raw_replica_mask_layer = replica_mask_layer.get();
- replica_layer->SetMaskLayer(replica_mask_layer.PassAs<LayerImpl>());
- raw_pending_layer->SetReplicaLayer(replica_layer.PassAs<LayerImpl>());
+ replica_layer->SetMaskLayer(replica_mask_layer.Pass());
+ raw_pending_layer->SetReplicaLayer(replica_layer.Pass());
ASSERT_EQ(raw_replica_mask_layer,
raw_pending_layer->replica_layer()->mask_layer());
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 876d8ae..7f9eb3b 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1664,8 +1664,7 @@ bool EvictionTestLayer::Update(ResourceUpdateQueue* queue,
scoped_ptr<LayerImpl> EvictionTestLayer::CreateLayerImpl(
LayerTreeImpl* tree_impl) {
- return EvictionTestLayerImpl::Create(tree_impl, layer_id_)
- .PassAs<LayerImpl>();
+ return EvictionTestLayerImpl::Create(tree_impl, layer_id_);
}
void EvictionTestLayer::PushPropertiesTo(LayerImpl* layer_impl) {
@@ -1903,7 +1902,7 @@ class LayerTreeHostWithProxy : public LayerTreeHost {
: LayerTreeHost(client, NULL, settings) {
proxy->SetLayerTreeHost(this);
client->SetLayerTreeHost(this);
- InitializeForTesting(proxy.PassAs<Proxy>());
+ InitializeForTesting(proxy.Pass());
}
};
@@ -2476,13 +2475,10 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
new MockIOSurfaceWebGraphicsContext3D);
mock_context_ = mock_context_owned.get();
- if (delegating_renderer()) {
- return FakeOutputSurface::CreateDelegating3d(
- mock_context_owned.PassAs<TestWebGraphicsContext3D>());
- } else {
- return FakeOutputSurface::Create3d(
- mock_context_owned.PassAs<TestWebGraphicsContext3D>());
- }
+ if (delegating_renderer())
+ return FakeOutputSurface::CreateDelegating3d(mock_context_owned.Pass());
+ else
+ return FakeOutputSurface::Create3d(mock_context_owned.Pass());
}
virtual void SetupTree() OVERRIDE {
@@ -2868,7 +2864,7 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
// Must clear all resources before exiting.
void ClearResources() {
for (int i = 0; i < num_ui_resources_; i++)
- ui_resources_[i].reset();
+ ui_resources_[i] = nullptr;
}
void CreateResource() {
@@ -2901,8 +2897,7 @@ class PushPropertiesCountingLayerImpl : public LayerImpl {
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE {
- return PushPropertiesCountingLayerImpl::Create(tree_impl, id()).
- PassAs<LayerImpl>();
+ return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
}
size_t push_properties_count() const { return push_properties_count_; }
@@ -2933,8 +2928,7 @@ class PushPropertiesCountingLayer : public Layer {
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE {
- return PushPropertiesCountingLayerImpl::Create(tree_impl, id()).
- PassAs<LayerImpl>();
+ return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
}
void SetDrawsContent(bool draws_content) { SetIsDrawable(draws_content); }
@@ -4734,7 +4728,7 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
PostSetNeedsCommitToMainThread();
break;
case 2:
- ui_resource_.reset();
+ ui_resource_ = nullptr;
EndTest();
break;
}
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 37e19ad..d7668c1 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1044,8 +1044,8 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
ScrollOffsetAnimationCurve::Create(
gfx::Vector2dF(500.f, 550.f),
EaseInOutTimingFunction::Create()));
- scoped_ptr<Animation> animation(Animation::Create(
- curve.PassAs<AnimationCurve>(), 1, 0, Animation::ScrollOffset));
+ scoped_ptr<Animation> animation(
+ Animation::Create(curve.Pass(), 1, 0, Animation::ScrollOffset));
animation->set_needs_synchronized_start_time(true);
bool animation_added = scroll_layer_->AddAnimation(animation.Pass());
bool impl_scrolling_supported =
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 75c2842..07e12a2 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -86,7 +86,7 @@ class LayerTreeHostContextTest : public LayerTreeTest {
if (times_to_fail_create_) {
--times_to_fail_create_;
ExpectCreateToFail();
- return scoped_ptr<FakeOutputSurface>();
+ return nullptr;
}
scoped_ptr<TestWebGraphicsContext3D> context3d = CreateContext3d();
@@ -363,7 +363,7 @@ class LayerTreeHostClientNotReadyDoesNotCreateOutputSurface
virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
OVERRIDE {
EXPECT_TRUE(false);
- return scoped_ptr<OutputSurface>();
+ return nullptr;
}
virtual void DidInitializeOutputSurface() OVERRIDE { EXPECT_TRUE(false); }
@@ -878,8 +878,8 @@ class LayerTreeHostContextTestDontUseLostResources
pass->AppendOneOfEveryQuadType(child_resource_provider_.get(),
RenderPassId(2, 1));
- frame_data->render_pass_list.push_back(pass_for_quad.PassAs<RenderPass>());
- frame_data->render_pass_list.push_back(pass.PassAs<RenderPass>());
+ frame_data->render_pass_list.push_back(pass_for_quad.Pass());
+ frame_data->render_pass_list.push_back(pass.Pass());
delegated_resource_collection_ = new DelegatedFrameResourceCollection;
delegated_frame_provider_ = new DelegatedFrameProvider(
@@ -1256,7 +1256,7 @@ class UIResourceLostAfterCommit : public UIResourceLostTestSimple {
break;
case 4:
// Release resource before ending the test.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
EndTest();
break;
case 5:
@@ -1316,7 +1316,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple {
// Currently one resource has been created.
test_id0_ = ui_resource_->id();
// Delete this resource.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
// Create another resource.
ui_resource_ = FakeScopedUIResource::Create(layer_tree_host());
test_id1_ = ui_resource_->id();
@@ -1327,7 +1327,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple {
break;
case 3:
// Clear the manager of resources.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
PostSetNeedsCommitToMainThread();
break;
case 4:
@@ -1337,7 +1337,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple {
// Sanity check the UIResourceId should not be 0.
EXPECT_NE(0, test_id0_);
// Usually ScopedUIResource are deleted from the manager in their
- // destructor (so usually ui_resource_.reset()). But here we need
+ // destructor (so usually ui_resource_ = nullptr). But here we need
// ui_resource_ for the next step, so call DeleteUIResource directly.
layer_tree_host()->DeleteUIResource(test_id0_);
// Delete the resouce and then lose the context.
@@ -1345,7 +1345,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple {
break;
case 5:
// Release resource before ending the test.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
EndTest();
break;
case 6:
@@ -1409,12 +1409,12 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest {
break;
case 3:
test_id_ = ui_resource_->id();
- ui_resource_.reset();
+ ui_resource_ = nullptr;
PostSetNeedsCommitToMainThread();
break;
case 5:
// Release resource before ending the test.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
EndTest();
break;
case 6:
@@ -1505,7 +1505,7 @@ class UIResourceLostEviction : public UIResourceLostTestSimple {
break;
case 3:
// Release resource before ending the test.
- ui_resource_.reset();
+ ui_resource_ = nullptr;
EndTest();
break;
case 4:
diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc
index 89a267a..6af1756 100644
--- a/cc/trees/layer_tree_host_unittest_copyrequest.cc
+++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc
@@ -592,7 +592,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface
// Now destroy the CopyOutputResult, releasing the texture inside back
// to the compositor.
EXPECT_TRUE(result_);
- result_.reset();
+ result_ = nullptr;
// Check that it is released.
ImplThreadTaskRunner()->PostTask(
diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
index 862f34bb..9e38f1c 100644
--- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc
+++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
@@ -113,8 +113,8 @@ class LayerTreeHostNoMessageLoopTest
void TearDownLayerTreeHost() {
// Explicit teardown to make failures easier to debug.
- layer_tree_host_.reset();
- root_layer_ = NULL;
+ layer_tree_host_ = nullptr;
+ root_layer_ = nullptr;
}
// All protected member variables are accessed only on |no_loop_thread_|.
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index d2db83a..9f2786c 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -1121,7 +1121,7 @@ TEST(LayerTreeHostFlingTest, DidStopFlingingThread) {
base::Unretained(&input_handler_client)));
layer_tree_host->DidStopFlinging();
- layer_tree_host.reset();
+ layer_tree_host = nullptr;
impl_thread.Stop();
EXPECT_TRUE(received_stop_flinging);
}
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 6e44bfc..ea9c1d01 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -108,7 +108,9 @@ LayerTreeImpl::~LayerTreeImpl() {
DCHECK(layers_with_copy_output_request_.empty());
}
-void LayerTreeImpl::Shutdown() { root_layer_.reset(); }
+void LayerTreeImpl::Shutdown() {
+ root_layer_ = nullptr;
+}
void LayerTreeImpl::ReleaseResources() {
if (root_layer_)
@@ -120,8 +122,8 @@ void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) {
inner_viewport_scroll_layer_->SetScrollOffsetDelegate(NULL);
if (outer_viewport_scroll_layer_)
outer_viewport_scroll_layer_->SetScrollOffsetDelegate(NULL);
- inner_viewport_scroll_delegate_proxy_.reset();
- outer_viewport_scroll_delegate_proxy_.reset();
+ inner_viewport_scroll_delegate_proxy_ = nullptr;
+ outer_viewport_scroll_delegate_proxy_ = nullptr;
root_layer_ = layer.Pass();
currently_scrolling_layer_ = NULL;
@@ -181,8 +183,8 @@ scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() {
inner_viewport_scroll_layer_->SetScrollOffsetDelegate(NULL);
if (outer_viewport_scroll_layer_)
outer_viewport_scroll_layer_->SetScrollOffsetDelegate(NULL);
- inner_viewport_scroll_delegate_proxy_.reset();
- outer_viewport_scroll_delegate_proxy_.reset();
+ inner_viewport_scroll_delegate_proxy_ = nullptr;
+ outer_viewport_scroll_delegate_proxy_ = nullptr;
inner_viewport_scroll_layer_ = NULL;
outer_viewport_scroll_layer_ = NULL;
page_scale_layer_ = NULL;
@@ -783,19 +785,17 @@ LayerTreeImpl::CreateScrollbarAnimationController(LayerImpl* scrolling_layer) {
switch (settings().scrollbar_animator) {
case LayerTreeSettings::LinearFade: {
return ScrollbarAnimationControllerLinearFade::Create(
- scrolling_layer, layer_tree_host_impl_, delay, duration)
- .PassAs<ScrollbarAnimationController>();
+ scrolling_layer, layer_tree_host_impl_, delay, duration);
}
case LayerTreeSettings::Thinning: {
return ScrollbarAnimationControllerThinning::Create(
- scrolling_layer, layer_tree_host_impl_, delay, duration)
- .PassAs<ScrollbarAnimationController>();
+ scrolling_layer, layer_tree_host_impl_, delay, duration);
}
case LayerTreeSettings::NoAnimator:
NOTREACHED();
break;
}
- return scoped_ptr<ScrollbarAnimationController>();
+ return nullptr;
}
void LayerTreeImpl::DidAnimateScrollOffset() {
@@ -881,8 +881,8 @@ void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
InnerViewportScrollLayer()->SetScrollOffsetDelegate(NULL);
if (OuterViewportScrollLayer())
OuterViewportScrollLayer()->SetScrollOffsetDelegate(NULL);
- inner_viewport_scroll_delegate_proxy_.reset();
- outer_viewport_scroll_delegate_proxy_.reset();
+ inner_viewport_scroll_delegate_proxy_ = nullptr;
+ outer_viewport_scroll_delegate_proxy_ = nullptr;
}
root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index a0dd11a..7fc1645 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -25,8 +25,7 @@ class LayerTreeImplTest : public LayerTreeHostCommonTest {
settings.layer_transforms_should_scale_layer_contents = true;
host_impl_.reset(
new FakeLayerTreeHostImpl(settings, &proxy_, &shared_bitmap_manager_));
- EXPECT_TRUE(host_impl_->InitializeRenderer(
- FakeOutputSurface::Create3d().PassAs<OutputSurface>()));
+ EXPECT_TRUE(host_impl_->InitializeRenderer(FakeOutputSurface::Create3d()));
}
FakeLayerTreeHostImpl& host_impl() { return *host_impl_; }
@@ -124,7 +123,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) {
hud->SetDrawsContent(true);
host_impl().active_tree()->set_hud_layer(hud.get());
- root->AddChild(hud.PassAs<LayerImpl>());
+ root->AddChild(hud.Pass());
host_impl().SetViewportSize(hud_bounds);
host_impl().active_tree()->SetRootLayer(root.Pass());
diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc
index 14a9ffd..37cd8a6 100644
--- a/cc/trees/occlusion_tracker_perftest.cc
+++ b/cc/trees/occlusion_tracker_perftest.cc
@@ -38,8 +38,7 @@ class OcclusionTrackerPerfTest : public testing::Test {
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
host_impl_ = LayerTreeHostImpl::Create(
settings, &client_, &proxy_, &stats_, shared_bitmap_manager_.get(), 1);
- host_impl_->InitializeRenderer(
- FakeOutputSurface::Create3d().PassAs<OutputSurface>());
+ host_impl_->InitializeRenderer(FakeOutputSurface::Create3d());
scoped_ptr<LayerImpl> root_layer = LayerImpl::Create(active_tree(), 1);
active_tree()->SetRootLayer(root_layer.Pass());
@@ -86,7 +85,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_FullyOccluded) {
opaque_layer->SetDrawsContent(true);
opaque_layer->SetBounds(viewport_rect.size());
opaque_layer->SetContentBounds(viewport_rect.size());
- active_tree()->root_layer()->AddChild(opaque_layer.PassAs<LayerImpl>());
+ active_tree()->root_layer()->AddChild(opaque_layer.Pass());
active_tree()->UpdateDrawProperties();
const LayerImplList& rsll = active_tree()->RenderSurfaceLayerList();
@@ -156,7 +155,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_10OpaqueLayers) {
opaque_layer->SetContentBounds(
gfx::Size(viewport_rect.width() / 2, viewport_rect.height() / 2));
opaque_layer->SetPosition(gfx::Point(i, i));
- active_tree()->root_layer()->AddChild(opaque_layer.PassAs<LayerImpl>());
+ active_tree()->root_layer()->AddChild(opaque_layer.Pass());
}
active_tree()->UpdateDrawProperties();
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index b35e437..3c6c440 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -121,13 +121,8 @@ struct OcclusionTrackerTestMainThreadTypes {
return make_scoped_refptr(new ContentLayerType());
}
- static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
- LayerPtrType ref(*layer);
- *layer = NULL;
- return ref;
- }
-
- static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
+ template <typename T>
+ static LayerPtrType PassLayerPtr(T* layer) {
LayerPtrType ref(*layer);
*layer = NULL;
return ref;
@@ -156,14 +151,11 @@ struct OcclusionTrackerTestImplThreadTypes {
}
static int next_layer_impl_id;
- static LayerPtrType PassLayerPtr(LayerPtrType* layer) {
+ template <typename T>
+ static LayerPtrType PassLayerPtr(T* layer) {
return layer->Pass();
}
- static LayerPtrType PassLayerPtr(ContentLayerPtrType* layer) {
- return layer->PassAs<LayerType>();
- }
-
static void DestroyLayer(LayerPtrType* layer) { layer->reset(); }
static void RecursiveUpdateNumChildren(LayerType* layer) {
@@ -286,7 +278,7 @@ template <typename Types> class OcclusionTrackerTest : public testing::Test {
void DestroyLayers() {
Types::DestroyLayer(&root_);
- render_surface_layer_list_.reset();
+ render_surface_layer_list_ = nullptr;
render_surface_layer_list_impl_.clear();
replica_layers_.clear();
mask_layers_.clear();
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 97b06bc..b3712b6 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -26,8 +26,7 @@ scoped_ptr<Proxy> SingleThreadProxy::Create(
LayerTreeHostSingleThreadClient* client,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) {
return make_scoped_ptr(
- new SingleThreadProxy(layer_tree_host, client, main_task_runner))
- .PassAs<Proxy>();
+ new SingleThreadProxy(layer_tree_host, client, main_task_runner));
}
SingleThreadProxy::SingleThreadProxy(
@@ -314,8 +313,8 @@ void SingleThreadProxy::Stop() {
blocking_main_thread_task_runner());
layer_tree_host_->DeleteContentsTexturesOnImplThread(
layer_tree_host_impl_->resource_provider());
- scheduler_on_impl_thread_.reset();
- layer_tree_host_impl_.reset();
+ scheduler_on_impl_thread_ = nullptr;
+ layer_tree_host_impl_ = nullptr;
}
layer_tree_host_ = NULL;
}
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index dddf112..151cb3c 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -49,9 +49,8 @@ scoped_ptr<Proxy> ThreadProxy::Create(
LayerTreeHost* layer_tree_host,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
- return make_scoped_ptr(new ThreadProxy(layer_tree_host,
- main_task_runner,
- impl_task_runner)).PassAs<Proxy>();
+ return make_scoped_ptr(
+ new ThreadProxy(layer_tree_host, main_task_runner, impl_task_runner));
}
ThreadProxy::ThreadProxy(
@@ -963,7 +962,7 @@ void ThreadProxy::ScheduledActionCommit() {
// Complete all remaining texture updates.
impl().current_resource_update_controller->Finalize();
- impl().current_resource_update_controller.reset();
+ impl().current_resource_update_controller = nullptr;
if (impl().animations_frozen_until_next_draw) {
impl().animation_time = std::max(
@@ -1249,10 +1248,10 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) {
DCHECK(IsMainThreadBlocked());
layer_tree_host()->DeleteContentsTexturesOnImplThread(
impl().layer_tree_host_impl->resource_provider());
- impl().current_resource_update_controller.reset();
+ impl().current_resource_update_controller = nullptr;
impl().layer_tree_host_impl->SetNeedsBeginFrame(false);
- impl().scheduler.reset();
- impl().layer_tree_host_impl.reset();
+ impl().scheduler = nullptr;
+ impl().layer_tree_host_impl = nullptr;
impl().weak_factory.InvalidateWeakPtrs();
// We need to explicitly cancel the notifier, since it isn't using weak ptrs.
// TODO(vmpstr): We should see if we can make it use weak ptrs and still keep
diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
index 1faf0e0..d17f017 100644
--- a/cc/trees/tree_synchronizer.cc
+++ b/cc/trees/tree_synchronizer.cc
@@ -105,7 +105,7 @@ scoped_ptr<LayerImpl> SynchronizeTreesRecursiveInternal(
LayerType* layer,
LayerTreeImpl* tree_impl) {
if (!layer)
- return scoped_ptr<LayerImpl>();
+ return nullptr;
scoped_ptr<LayerImpl> layer_impl =
ReuseOrCreateLayerImpl(new_layers, old_layers, layer, tree_impl);
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index b0e2114..007c857 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -56,7 +56,7 @@ class MockLayer : public Layer {
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE {
- return MockLayerImpl::Create(tree_impl, layer_id_).PassAs<LayerImpl>();
+ return MockLayerImpl::Create(tree_impl, layer_id_);
}
virtual void PushPropertiesTo(LayerImpl* layer_impl) OVERRIDE {