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

Side by Side Diff: cc/tiling_data.cc

Issue 12221077: Fixing tile grid size used by cc:Picture to make it respect current tile configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix for picture_layer_impl_unittest Created 7 years, 10 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
« cc/picture_pile.cc ('K') | « cc/tiling_data.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/tiling_data.h" 5 #include "cc/tiling_data.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/gfx/vector2d.h" 10 #include "ui/gfx/vector2d.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 int top = (!y_index || num_tiles_y_ == 1) ? 0 : border_texels_; 249 int top = (!y_index || num_tiles_y_ == 1) ? 0 : border_texels_;
250 250
251 return gfx::Vector2d(left, top); 251 return gfx::Vector2d(left, top);
252 } 252 }
253 253
254 void TilingData::RecomputeNumTiles() { 254 void TilingData::RecomputeNumTiles() {
255 num_tiles_x_ = ComputeNumTiles(max_texture_size_.width(), total_size_.width(), border_texels_); 255 num_tiles_x_ = ComputeNumTiles(max_texture_size_.width(), total_size_.width(), border_texels_);
256 num_tiles_y_ = ComputeNumTiles(max_texture_size_.height(), total_size_.height( ), border_texels_); 256 num_tiles_y_ = ComputeNumTiles(max_texture_size_.height(), total_size_.height( ), border_texels_);
257 } 257 }
258 258
259 gfx::Size TilingData::TileStride() const {
260 gfx::Size tile_grid_size = max_texture_size_;
261 tile_grid_size.Enlarge(- 2 * border_texels_, - 2 * border_texels_);
danakj 2013/02/11 17:12:46 Does the TileGrid assume border pixels are on the
262 return tile_grid_size;
263 }
264
259 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data) 265 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data)
260 : tiling_data_(tiling_data), 266 : tiling_data_(tiling_data),
261 index_x_(-1), 267 index_x_(-1),
262 index_y_(-1) { 268 index_y_(-1) {
263 } 269 }
264 270
265 TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect) 271 TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect)
266 : BaseIterator(tiling_data), 272 : BaseIterator(tiling_data),
267 left_(-1), 273 left_(-1),
268 right_(-1), 274 right_(-1),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 395 }
390 396
391 if (index_y_ > consider_bottom_) 397 if (index_y_ > consider_bottom_)
392 done(); 398 done();
393 } 399 }
394 400
395 return *this; 401 return *this;
396 } 402 }
397 403
398 } // namespace cc 404 } // namespace cc
OLDNEW
« cc/picture_pile.cc ('K') | « cc/tiling_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698