| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |