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

Side by Side Diff: cc/layer_tiling_data.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseonenne Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_texture_sub_image.cc ('k') | cc/layer_tree_host.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 5
6 #include "config.h" 6 #include "config.h"
7 7
8 #include "CCLayerTilingData.h" 8 #include "CCLayerTilingData.h"
9 9
10 #include "base/logging.h"
11
10 using namespace std; 12 using namespace std;
11 13
12 namespace cc { 14 namespace cc {
13 15
14 scoped_ptr<CCLayerTilingData> CCLayerTilingData::create(const IntSize& tileSize, BorderTexelOption border) 16 scoped_ptr<CCLayerTilingData> CCLayerTilingData::create(const IntSize& tileSize, BorderTexelOption border)
15 { 17 {
16 return make_scoped_ptr(new CCLayerTilingData(tileSize, border)); 18 return make_scoped_ptr(new CCLayerTilingData(tileSize, border));
17 } 19 }
18 20
19 CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption border) 21 CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption border)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 55
54 const CCLayerTilingData& CCLayerTilingData::operator=(const CCLayerTilingData& t iler) 56 const CCLayerTilingData& CCLayerTilingData::operator=(const CCLayerTilingData& t iler)
55 { 57 {
56 m_tilingData = tiler.m_tilingData; 58 m_tilingData = tiler.m_tilingData;
57 59
58 return *this; 60 return *this;
59 } 61 }
60 62
61 void CCLayerTilingData::addTile(scoped_ptr<Tile> tile, int i, int j) 63 void CCLayerTilingData::addTile(scoped_ptr<Tile> tile, int i, int j)
62 { 64 {
63 ASSERT(!tileAt(i, j)); 65 DCHECK(!tileAt(i, j));
64 tile->moveTo(i, j); 66 tile->moveTo(i, j);
65 m_tiles.add(make_pair(i, j), tile.Pass()); 67 m_tiles.add(make_pair(i, j), tile.Pass());
66 } 68 }
67 69
68 scoped_ptr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j) 70 scoped_ptr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j)
69 { 71 {
70 return m_tiles.take_and_erase(make_pair(i, j)); 72 return m_tiles.take_and_erase(make_pair(i, j));
71 } 73 }
72 74
73 CCLayerTilingData::Tile* CCLayerTilingData::tileAt(int i, int j) const 75 CCLayerTilingData::Tile* CCLayerTilingData::tileAt(int i, int j) const
74 { 76 {
75 return m_tiles.get(make_pair(i, j)); 77 return m_tiles.get(make_pair(i, j));
76 } 78 }
77 79
78 void CCLayerTilingData::reset() 80 void CCLayerTilingData::reset()
79 { 81 {
80 m_tiles.clear(); 82 m_tiles.clear();
81 } 83 }
82 84
83 void CCLayerTilingData::contentRectToTileIndices(const IntRect& contentRect, int & left, int& top, int& right, int& bottom) const 85 void CCLayerTilingData::contentRectToTileIndices(const IntRect& contentRect, int & left, int& top, int& right, int& bottom) const
84 { 86 {
85 // An empty rect doesn't result in an empty set of tiles, so don't pass an e mpty rect. 87 // An empty rect doesn't result in an empty set of tiles, so don't pass an e mpty rect.
86 // FIXME: Possibly we should fill a vector of tiles instead, 88 // FIXME: Possibly we should fill a vector of tiles instead,
87 // since the normal use of this function is to enumerate some tiles. 89 // since the normal use of this function is to enumerate some tiles.
88 ASSERT(!contentRect.isEmpty()); 90 DCHECK(!contentRect.isEmpty());
89 91
90 left = m_tilingData.tileXIndexFromSrcCoord(contentRect.x()); 92 left = m_tilingData.tileXIndexFromSrcCoord(contentRect.x());
91 top = m_tilingData.tileYIndexFromSrcCoord(contentRect.y()); 93 top = m_tilingData.tileYIndexFromSrcCoord(contentRect.y());
92 right = m_tilingData.tileXIndexFromSrcCoord(contentRect.maxX() - 1); 94 right = m_tilingData.tileXIndexFromSrcCoord(contentRect.maxX() - 1);
93 bottom = m_tilingData.tileYIndexFromSrcCoord(contentRect.maxY() - 1); 95 bottom = m_tilingData.tileYIndexFromSrcCoord(contentRect.maxY() - 1);
94 } 96 }
95 97
96 IntRect CCLayerTilingData::tileRect(const Tile* tile) const 98 IntRect CCLayerTilingData::tileRect(const Tile* tile) const
97 { 99 {
98 IntRect tileRect = m_tilingData.tileBoundsWithBorder(tile->i(), tile->j()); 100 IntRect tileRect = m_tilingData.tileBoundsWithBorder(tile->i(), tile->j());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 for (size_t i = 0; i < invalidTileKeys.size(); ++i) 142 for (size_t i = 0; i < invalidTileKeys.size(); ++i)
141 m_tiles.erase(invalidTileKeys[i]); 143 m_tiles.erase(invalidTileKeys[i]);
142 } 144 }
143 145
144 IntSize CCLayerTilingData::bounds() const 146 IntSize CCLayerTilingData::bounds() const
145 { 147 {
146 return m_tilingData.totalSize(); 148 return m_tilingData.totalSize();
147 } 149 }
148 150
149 } // namespace cc 151 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_texture_sub_image.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698