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

Side by Side Diff: cc/resources/layer_tiling_data.cc

Issue 12967018: cc: Avoid pointless gfx::Point/Size contructors when making Rects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RectFs as well Created 7 years, 9 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
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 "cc/resources/layer_tiling_data.h" 5 #include "cc/resources/layer_tiling_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 tiling_data_.SetTotalSize(size); 113 tiling_data_.SetTotalSize(size);
114 if (size.IsEmpty()) { 114 if (size.IsEmpty()) {
115 tiles_.clear(); 115 tiles_.clear();
116 return; 116 return;
117 } 117 }
118 118
119 // Any tiles completely outside our new bounds are invalid and should be 119 // Any tiles completely outside our new bounds are invalid and should be
120 // dropped. 120 // dropped.
121 int left, top, right, bottom; 121 int left, top, right, bottom;
122 ContentRectToTileIndices( 122 ContentRectToTileIndices(
123 gfx::Rect(gfx::Point(), size), &left, &top, &right, &bottom); 123 gfx::Rect(size), &left, &top, &right, &bottom);
124 std::vector<TileMapKey> invalid_tile_keys; 124 std::vector<TileMapKey> invalid_tile_keys;
125 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { 125 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
126 if (it->first.first > right || it->first.second > bottom) 126 if (it->first.first > right || it->first.second > bottom)
127 invalid_tile_keys.push_back(it->first); 127 invalid_tile_keys.push_back(it->first);
128 } 128 }
129 for (size_t i = 0; i < invalid_tile_keys.size(); ++i) 129 for (size_t i = 0; i < invalid_tile_keys.size(); ++i)
130 tiles_.erase(invalid_tile_keys[i]); 130 tiles_.erase(invalid_tile_keys[i]);
131 } 131 }
132 132
133 } // namespace cc 133 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/resources/picture_layer_tiling_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698