| 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/tiled_layer.h" | 5 #include "cc/tiled_layer.h" |
| 6 | 6 |
| 7 #include "cc/bitmap_content_layer_updater.h" | 7 #include "cc/bitmap_content_layer_updater.h" |
| 8 #include "cc/layer_painter.h" | 8 #include "cc/layer_painter.h" |
| 9 #include "cc/overdraw_metrics.h" | 9 #include "cc/overdraw_metrics.h" |
| 10 #include "cc/rendering_stats.h" | 10 #include "cc/rendering_stats.h" |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 m_layerTreeHost->commitComplete(); | 1564 m_layerTreeHost->commitComplete(); |
| 1565 | 1565 |
| 1566 resourceManagerClearAllMemory(m_layerTreeHost->contentsTextureManager(), m_r
esourceProvider.get()); | 1566 resourceManagerClearAllMemory(m_layerTreeHost->contentsTextureManager(), m_r
esourceProvider.get()); |
| 1567 m_layerTreeHost->setRootLayer(0); | 1567 m_layerTreeHost->setRootLayer(0); |
| 1568 } | 1568 } |
| 1569 | 1569 |
| 1570 class TrackingLayerPainter : public LayerPainter { | 1570 class TrackingLayerPainter : public LayerPainter { |
| 1571 public: | 1571 public: |
| 1572 static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(ne
w TrackingLayerPainter()); } | 1572 static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(ne
w TrackingLayerPainter()); } |
| 1573 | 1573 |
| 1574 virtual void paint(SkCanvas*, const gfx::Rect& contentRect, gfx::RectF&) OVE
RRIDE | 1574 virtual void paint(SkCanvas*, gfx::Rect contentRect, gfx::RectF&) OVERRIDE |
| 1575 { | 1575 { |
| 1576 m_paintedRect = contentRect; | 1576 m_paintedRect = contentRect; |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 const gfx::Rect& paintedRect() const { return m_paintedRect; } | 1579 const gfx::Rect& paintedRect() const { return m_paintedRect; } |
| 1580 void resetPaintedRect() { m_paintedRect = gfx::Rect(); } | 1580 void resetPaintedRect() { m_paintedRect = gfx::Rect(); } |
| 1581 | 1581 |
| 1582 private: | 1582 private: |
| 1583 TrackingLayerPainter() { } | 1583 TrackingLayerPainter() { } |
| 1584 | 1584 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 | 1663 |
| 1664 // Invalidate the entire layer in layer space. When painting, the rect given
to webkit should match the layer's bounds. | 1664 // Invalidate the entire layer in layer space. When painting, the rect given
to webkit should match the layer's bounds. |
| 1665 layer->setNeedsDisplayRect(layerRect); | 1665 layer->setNeedsDisplayRect(layerRect); |
| 1666 layer->update(*m_queue.get(), 0, m_stats); | 1666 layer->update(*m_queue.get(), 0, m_stats); |
| 1667 | 1667 |
| 1668 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); | 1668 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 } // namespace | 1671 } // namespace |
| 1672 } // namespace cc | 1672 } // namespace cc |
| OLD | NEW |