| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "TiledLayerChromium.h" | 7 #include "TiledLayerChromium.h" |
| 8 | 8 |
| 9 #include "BitmapCanvasLayerTextureUpdater.h" | 9 #include "BitmapCanvasLayerTextureUpdater.h" |
| 10 #include "CCAnimationTestCommon.h" | 10 #include "CCAnimationTestCommon.h" |
| (...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 } | 1450 } |
| 1451 } | 1451 } |
| 1452 ccLayerTreeHost->commitComplete(); | 1452 ccLayerTreeHost->commitComplete(); |
| 1453 | 1453 |
| 1454 textureManagerClearAllMemory(ccLayerTreeHost->contentsTextureManager(), m_re
sourceProvider.get()); | 1454 textureManagerClearAllMemory(ccLayerTreeHost->contentsTextureManager(), m_re
sourceProvider.get()); |
| 1455 ccLayerTreeHost->setRootLayer(0); | 1455 ccLayerTreeHost->setRootLayer(0); |
| 1456 } | 1456 } |
| 1457 | 1457 |
| 1458 class TrackingLayerPainter : public LayerPainterChromium { | 1458 class TrackingLayerPainter : public LayerPainterChromium { |
| 1459 public: | 1459 public: |
| 1460 static PassOwnPtr<TrackingLayerPainter> create() { return adoptPtr(new Track
ingLayerPainter()); } | 1460 static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(ne
w TrackingLayerPainter()); } |
| 1461 | 1461 |
| 1462 virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect&) OVERRI
DE | 1462 virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect&) OVERRI
DE |
| 1463 { | 1463 { |
| 1464 m_paintedRect = contentRect; | 1464 m_paintedRect = contentRect; |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 const IntRect& paintedRect() const { return m_paintedRect; } | 1467 const IntRect& paintedRect() const { return m_paintedRect; } |
| 1468 void resetPaintedRect() { m_paintedRect = IntRect(); } | 1468 void resetPaintedRect() { m_paintedRect = IntRect(); } |
| 1469 | 1469 |
| 1470 private: | 1470 private: |
| 1471 TrackingLayerPainter() { } | 1471 TrackingLayerPainter() { } |
| 1472 | 1472 |
| 1473 IntRect m_paintedRect; | 1473 IntRect m_paintedRect; |
| 1474 }; | 1474 }; |
| 1475 | 1475 |
| 1476 class UpdateTrackingTiledLayerChromium : public FakeTiledLayerChromium { | 1476 class UpdateTrackingTiledLayerChromium : public FakeTiledLayerChromium { |
| 1477 public: | 1477 public: |
| 1478 explicit UpdateTrackingTiledLayerChromium(CCPrioritizedTextureManager* manag
er) | 1478 explicit UpdateTrackingTiledLayerChromium(CCPrioritizedTextureManager* manag
er) |
| 1479 : FakeTiledLayerChromium(manager) | 1479 : FakeTiledLayerChromium(manager) |
| 1480 { | 1480 { |
| 1481 OwnPtr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPainter::
create()); | 1481 scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPaint
er::create()); |
| 1482 m_trackingLayerPainter = trackingLayerPainter.get(); | 1482 m_trackingLayerPainter = trackingLayerPainter.get(); |
| 1483 m_layerTextureUpdater = BitmapCanvasLayerTextureUpdater::create(tracking
LayerPainter.release()); | 1483 m_layerTextureUpdater = BitmapCanvasLayerTextureUpdater::create(tracking
LayerPainter.PassAs<LayerPainterChromium>()); |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 TrackingLayerPainter* trackingLayerPainter() const { return m_trackingLayerP
ainter; } | 1486 TrackingLayerPainter* trackingLayerPainter() const { return m_trackingLayerP
ainter; } |
| 1487 | 1487 |
| 1488 protected: | 1488 protected: |
| 1489 virtual ~UpdateTrackingTiledLayerChromium() { } | 1489 virtual ~UpdateTrackingTiledLayerChromium() { } |
| 1490 | 1490 |
| 1491 virtual LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_laye
rTextureUpdater.get(); } | 1491 virtual LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_laye
rTextureUpdater.get(); } |
| 1492 | 1492 |
| 1493 private: | 1493 private: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 updateTextures(); | 1550 updateTextures(); |
| 1551 | 1551 |
| 1552 // Invalidate the entire layer in layer space. When painting, the rect given
to webkit should match the layer's bounds. | 1552 // Invalidate the entire layer in layer space. When painting, the rect given
to webkit should match the layer's bounds. |
| 1553 layer->setNeedsDisplayRect(layerRect); | 1553 layer->setNeedsDisplayRect(layerRect); |
| 1554 layer->update(*m_queue.get(), 0, m_stats); | 1554 layer->update(*m_queue.get(), 0, m_stats); |
| 1555 | 1555 |
| 1556 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); | 1556 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); |
| 1557 } | 1557 } |
| 1558 | 1558 |
| 1559 } // namespace | 1559 } // namespace |
| OLD | NEW |