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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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_unittest.cc ('k') | cc/layers/ui_resource_layer_impl_unittest.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 "cc/debug/overdraw_metrics.h" 10 #include "cc/debug/overdraw_metrics.h"
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 layer_tree_host_->SetRootLayer(NULL); 1836 layer_tree_host_->SetRootLayer(NULL);
1837 } 1837 }
1838 1838
1839 class TrackingLayerPainter : public LayerPainter { 1839 class TrackingLayerPainter : public LayerPainter {
1840 public: 1840 public:
1841 static scoped_ptr<TrackingLayerPainter> Create() { 1841 static scoped_ptr<TrackingLayerPainter> Create() {
1842 return make_scoped_ptr(new TrackingLayerPainter()); 1842 return make_scoped_ptr(new TrackingLayerPainter());
1843 } 1843 }
1844 1844
1845 virtual void Paint(SkCanvas* canvas, 1845 virtual void Paint(SkCanvas* canvas,
1846 gfx::Rect content_rect, 1846 const gfx::Rect& content_rect,
1847 gfx::RectF* opaque) OVERRIDE { 1847 gfx::RectF* opaque) OVERRIDE {
1848 painted_rect_ = content_rect; 1848 painted_rect_ = content_rect;
1849 } 1849 }
1850 1850
1851 gfx::Rect PaintedRect() const { return painted_rect_; } 1851 gfx::Rect PaintedRect() const { return painted_rect_; }
1852 void ResetPaintedRect() { painted_rect_ = gfx::Rect(); } 1852 void ResetPaintedRect() { painted_rect_ = gfx::Rect(); }
1853 1853
1854 private: 1854 private:
1855 gfx::Rect painted_rect_; 1855 gfx::Rect painted_rect_;
1856 }; 1856 };
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 // Invalidate the entire layer in layer space. When painting, the rect given 1947 // Invalidate the entire layer in layer space. When painting, the rect given
1948 // to webkit should match the layer's bounds. 1948 // to webkit should match the layer's bounds.
1949 layer->SetNeedsDisplayRect(layer_rect); 1949 layer->SetNeedsDisplayRect(layer_rect);
1950 layer->Update(queue_.get(), NULL); 1950 layer->Update(queue_.get(), NULL);
1951 1951
1952 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); 1952 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect());
1953 } 1953 }
1954 1954
1955 } // namespace 1955 } // namespace
1956 } // namespace cc 1956 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_impl_unittest.cc ('k') | cc/layers/ui_resource_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698