Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: cc/layers/tiled_layer_unittest.cc

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/tiled_layer_impl.cc ('k') | cc/layers/ui_resource_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/tiled_layer.h" 5 #include "cc/layers/tiled_layer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 host_impl_ = make_scoped_ptr( 133 host_impl_ = make_scoped_ptr(
134 new FakeLayerTreeHostImpl(proxy_, shared_bitmap_manager_.get())); 134 new FakeLayerTreeHostImpl(proxy_, shared_bitmap_manager_.get()));
135 } 135 }
136 136
137 virtual ~TiledLayerTest() { 137 virtual ~TiledLayerTest() {
138 ResourceManagerClearAllMemory(resource_manager_.get(), 138 ResourceManagerClearAllMemory(resource_manager_.get(),
139 resource_provider_.get()); 139 resource_provider_.get());
140 140
141 DebugScopedSetImplThreadAndMainThreadBlocked 141 DebugScopedSetImplThreadAndMainThreadBlocked
142 impl_thread_and_main_thread_blocked(proxy_); 142 impl_thread_and_main_thread_blocked(proxy_);
143 resource_provider_ = nullptr; 143 resource_provider_.reset();
144 host_impl_ = nullptr; 144 host_impl_.reset();
145 } 145 }
146 146
147 void ResourceManagerClearAllMemory( 147 void ResourceManagerClearAllMemory(
148 PrioritizedResourceManager* resource_manager, 148 PrioritizedResourceManager* resource_manager,
149 ResourceProvider* resource_provider) { 149 ResourceProvider* resource_provider) {
150 { 150 {
151 DebugScopedSetImplThreadAndMainThreadBlocked 151 DebugScopedSetImplThreadAndMainThreadBlocked
152 impl_thread_and_main_thread_blocked(proxy_); 152 impl_thread_and_main_thread_blocked(proxy_);
153 resource_manager->ClearAllMemory(resource_provider); 153 resource_manager->ClearAllMemory(resource_provider);
154 resource_manager->ReduceMemory(resource_provider); 154 resource_manager->ReduceMemory(resource_provider);
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 private: 1658 private:
1659 gfx::Rect painted_rect_; 1659 gfx::Rect painted_rect_;
1660 }; 1660 };
1661 1661
1662 class UpdateTrackingTiledLayer : public FakeTiledLayer { 1662 class UpdateTrackingTiledLayer : public FakeTiledLayer {
1663 public: 1663 public:
1664 explicit UpdateTrackingTiledLayer(PrioritizedResourceManager* manager) 1664 explicit UpdateTrackingTiledLayer(PrioritizedResourceManager* manager)
1665 : FakeTiledLayer(manager) { 1665 : FakeTiledLayer(manager) {
1666 scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create()); 1666 scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create());
1667 tracking_layer_painter_ = painter.get(); 1667 tracking_layer_painter_ = painter.get();
1668 layer_updater_ = BitmapContentLayerUpdater::Create( 1668 layer_updater_ =
1669 painter.Pass(), &stats_instrumentation_, 0); 1669 BitmapContentLayerUpdater::Create(painter.PassAs<LayerPainter>(),
1670 &stats_instrumentation_,
1671 0);
1670 } 1672 }
1671 1673
1672 TrackingLayerPainter* tracking_layer_painter() const { 1674 TrackingLayerPainter* tracking_layer_painter() const {
1673 return tracking_layer_painter_; 1675 return tracking_layer_painter_;
1674 } 1676 }
1675 1677
1676 private: 1678 private:
1677 virtual LayerUpdater* Updater() const OVERRIDE { 1679 virtual LayerUpdater* Updater() const OVERRIDE {
1678 return layer_updater_.get(); 1680 return layer_updater_.get();
1679 } 1681 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 1759
1758 // Rounding leads to an extra pixel. 1760 // Rounding leads to an extra pixel.
1759 gfx::Rect expanded_layer_rect(layer_rect); 1761 gfx::Rect expanded_layer_rect(layer_rect);
1760 expanded_layer_rect.set_height(32); 1762 expanded_layer_rect.set_height(32);
1761 EXPECT_RECT_EQ(expanded_layer_rect, 1763 EXPECT_RECT_EQ(expanded_layer_rect,
1762 layer->tracking_layer_painter()->PaintedRect()); 1764 layer->tracking_layer_painter()->PaintedRect());
1763 } 1765 }
1764 1766
1765 } // namespace 1767 } // namespace
1766 } // namespace cc 1768 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_impl.cc ('k') | cc/layers/ui_resource_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698