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

Side by Side Diff: cc/tiled_layer_unittest.cc

Issue 11266030: Use gfx:: Geometry types for the resource provider and layer updater classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uint8 Created 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/tiled_layer.cc ('k') | cc/video_layer_impl.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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/tiled_layer.h" 7 #include "cc/tiled_layer.h"
8 8
9 #include "cc/bitmap_content_layer_updater.h" 9 #include "cc/bitmap_content_layer_updater.h"
10 #include "cc/layer_painter.h" 10 #include "cc/layer_painter.h"
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 layerTreeHost->commitComplete(); 1522 layerTreeHost->commitComplete();
1523 1523
1524 textureManagerClearAllMemory(layerTreeHost->contentsTextureManager(), m_reso urceProvider.get()); 1524 textureManagerClearAllMemory(layerTreeHost->contentsTextureManager(), m_reso urceProvider.get());
1525 layerTreeHost->setRootLayer(0); 1525 layerTreeHost->setRootLayer(0);
1526 } 1526 }
1527 1527
1528 class TrackingLayerPainter : public LayerPainter { 1528 class TrackingLayerPainter : public LayerPainter {
1529 public: 1529 public:
1530 static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(ne w TrackingLayerPainter()); } 1530 static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(ne w TrackingLayerPainter()); }
1531 1531
1532 virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect&) OVERRI DE 1532 virtual void paint(SkCanvas*, const gfx::Rect& contentRect, gfx::RectF&) OVE RRIDE
1533 { 1533 {
1534 m_paintedRect = contentRect; 1534 m_paintedRect = contentRect;
1535 } 1535 }
1536 1536
1537 const IntRect& paintedRect() const { return m_paintedRect; } 1537 const gfx::Rect& paintedRect() const { return m_paintedRect; }
1538 void resetPaintedRect() { m_paintedRect = IntRect(); } 1538 void resetPaintedRect() { m_paintedRect = gfx::Rect(); }
1539 1539
1540 private: 1540 private:
1541 TrackingLayerPainter() { } 1541 TrackingLayerPainter() { }
1542 1542
1543 IntRect m_paintedRect; 1543 gfx::Rect m_paintedRect;
1544 }; 1544 };
1545 1545
1546 class UpdateTrackingTiledLayer : public FakeTiledLayer { 1546 class UpdateTrackingTiledLayer : public FakeTiledLayer {
1547 public: 1547 public:
1548 explicit UpdateTrackingTiledLayer(PrioritizedTextureManager* manager) 1548 explicit UpdateTrackingTiledLayer(PrioritizedTextureManager* manager)
1549 : FakeTiledLayer(manager) 1549 : FakeTiledLayer(manager)
1550 { 1550 {
1551 scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPaint er::create()); 1551 scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPaint er::create());
1552 m_trackingLayerPainter = trackingLayerPainter.get(); 1552 m_trackingLayerPainter = trackingLayerPainter.get();
1553 m_layerUpdater = BitmapContentLayerUpdater::create(trackingLayerPainter. PassAs<LayerPainter>()); 1553 m_layerUpdater = BitmapContentLayerUpdater::create(trackingLayerPainter. PassAs<LayerPainter>());
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 updateTextures(); 1620 updateTextures();
1621 1621
1622 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. 1622 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
1623 layer->setNeedsDisplayRect(layerRect); 1623 layer->setNeedsDisplayRect(layerRect);
1624 layer->update(*m_queue.get(), 0, m_stats); 1624 layer->update(*m_queue.get(), 0, m_stats);
1625 1625
1626 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); 1626 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
1627 } 1627 }
1628 1628
1629 } // namespace 1629 } // namespace
OLDNEW
« no previous file with comments | « cc/tiled_layer.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698