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

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

Issue 707963003: cc: Remove main thread rendering stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added out of line constructor Created 6 years, 1 month 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/picture_layer_impl_unittest.cc ('k') | cc/resources/bitmap_content_layer_updater.h » ('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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 private: 1656 private:
1657 gfx::Rect painted_rect_; 1657 gfx::Rect painted_rect_;
1658 }; 1658 };
1659 1659
1660 class UpdateTrackingTiledLayer : public FakeTiledLayer { 1660 class UpdateTrackingTiledLayer : public FakeTiledLayer {
1661 public: 1661 public:
1662 explicit UpdateTrackingTiledLayer(PrioritizedResourceManager* manager) 1662 explicit UpdateTrackingTiledLayer(PrioritizedResourceManager* manager)
1663 : FakeTiledLayer(manager) { 1663 : FakeTiledLayer(manager) {
1664 scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create()); 1664 scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create());
1665 tracking_layer_painter_ = painter.get(); 1665 tracking_layer_painter_ = painter.get();
1666 layer_updater_ = BitmapContentLayerUpdater::Create( 1666 layer_updater_ = BitmapContentLayerUpdater::Create(painter.Pass(), 0);
1667 painter.Pass(), &stats_instrumentation_, 0);
1668 } 1667 }
1669 1668
1670 TrackingLayerPainter* tracking_layer_painter() const { 1669 TrackingLayerPainter* tracking_layer_painter() const {
1671 return tracking_layer_painter_; 1670 return tracking_layer_painter_;
1672 } 1671 }
1673 1672
1674 private: 1673 private:
1675 LayerUpdater* Updater() const override { return layer_updater_.get(); } 1674 LayerUpdater* Updater() const override { return layer_updater_.get(); }
1676 ~UpdateTrackingTiledLayer() override {} 1675 ~UpdateTrackingTiledLayer() override {}
1677 1676
1678 TrackingLayerPainter* tracking_layer_painter_; 1677 TrackingLayerPainter* tracking_layer_painter_;
1679 scoped_refptr<BitmapContentLayerUpdater> layer_updater_; 1678 scoped_refptr<BitmapContentLayerUpdater> layer_updater_;
1680 FakeRenderingStatsInstrumentation stats_instrumentation_;
1681 }; 1679 };
1682 1680
1683 TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) { 1681 TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
1684 scoped_refptr<UpdateTrackingTiledLayer> layer = 1682 scoped_refptr<UpdateTrackingTiledLayer> layer =
1685 make_scoped_refptr(new UpdateTrackingTiledLayer(resource_manager_.get())); 1683 make_scoped_refptr(new UpdateTrackingTiledLayer(resource_manager_.get()));
1686 1684
1687 layer_tree_host_->root_layer()->AddChild(layer); 1685 layer_tree_host_->root_layer()->AddChild(layer);
1688 1686
1689 gfx::Rect layer_rect(0, 0, 30, 31); 1687 gfx::Rect layer_rect(0, 0, 30, 31);
1690 layer->SetPosition(layer_rect.origin()); 1688 layer->SetPosition(layer_rect.origin());
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 1751
1754 // Rounding leads to an extra pixel. 1752 // Rounding leads to an extra pixel.
1755 gfx::Rect expanded_layer_rect(layer_rect); 1753 gfx::Rect expanded_layer_rect(layer_rect);
1756 expanded_layer_rect.set_height(32); 1754 expanded_layer_rect.set_height(32);
1757 EXPECT_RECT_EQ(expanded_layer_rect, 1755 EXPECT_RECT_EQ(expanded_layer_rect,
1758 layer->tracking_layer_painter()->PaintedRect()); 1756 layer->tracking_layer_painter()->PaintedRect());
1759 } 1757 }
1760 1758
1761 } // namespace 1759 } // namespace
1762 } // namespace cc 1760 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/bitmap_content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698