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

Side by Side Diff: cc/base/tiling_data.cc

Issue 183663003: cc: Add tiling raster tile iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « cc/base/tiling_data.h ('k') | cc/resources/managed_tile_state.h » ('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 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/base/tiling_data.h" 5 #include "cc/base/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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 num_tiles_y_ = ComputeNumTiles( 265 num_tiles_y_ = ComputeNumTiles(
266 max_texture_size_.height(), total_size_.height(), border_texels_); 266 max_texture_size_.height(), total_size_.height(), border_texels_);
267 } 267 }
268 268
269 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data) 269 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data)
270 : tiling_data_(tiling_data), 270 : tiling_data_(tiling_data),
271 index_x_(-1), 271 index_x_(-1),
272 index_y_(-1) { 272 index_y_(-1) {
273 } 273 }
274 274
275 TilingData::Iterator::Iterator() : BaseIterator(NULL) { done(); }
276
275 TilingData::Iterator::Iterator(const TilingData* tiling_data, 277 TilingData::Iterator::Iterator(const TilingData* tiling_data,
276 const gfx::Rect& tiling_rect) 278 const gfx::Rect& tiling_rect)
277 : BaseIterator(tiling_data), 279 : BaseIterator(tiling_data),
278 left_(-1), 280 left_(-1),
279 right_(-1), 281 right_(-1),
280 bottom_(-1) { 282 bottom_(-1) {
281 if (tiling_data_->num_tiles_x() <= 0 || tiling_data_->num_tiles_y() <= 0) { 283 if (tiling_data_->num_tiles_x() <= 0 || tiling_data_->num_tiles_y() <= 0) {
282 done(); 284 done();
283 return; 285 return;
284 } 286 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 } 404 }
403 } 405 }
404 406
405 if (index_y_ > consider_bottom_) 407 if (index_y_ > consider_bottom_)
406 done(); 408 done();
407 } 409 }
408 410
409 return *this; 411 return *this;
410 } 412 }
411 413
414 TilingData::SpiralDifferenceIterator::SpiralDifferenceIterator()
415 : BaseIterator(NULL) {
416 done();
417 }
418
412 TilingData::SpiralDifferenceIterator::SpiralDifferenceIterator( 419 TilingData::SpiralDifferenceIterator::SpiralDifferenceIterator(
413 const TilingData* tiling_data, 420 const TilingData* tiling_data,
414 const gfx::Rect& consider_rect, 421 const gfx::Rect& consider_rect,
415 const gfx::Rect& ignore_rect, 422 const gfx::Rect& ignore_rect,
416 const gfx::Rect& center_rect) 423 const gfx::Rect& center_rect)
417 : BaseIterator(tiling_data), 424 : BaseIterator(tiling_data),
418 consider_left_(-1), 425 consider_left_(-1),
419 consider_top_(-1), 426 consider_top_(-1),
420 consider_right_(-1), 427 consider_right_(-1),
421 consider_bottom_(-1), 428 consider_bottom_(-1),
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 current_step_ = 0; 636 current_step_ = 0;
630 direction_ = static_cast<Direction>((direction_ + 1) % 4); 637 direction_ = static_cast<Direction>((direction_ + 1) % 4);
631 638
632 if (direction_ == RIGHT || direction_ == LEFT) { 639 if (direction_ == RIGHT || direction_ == LEFT) {
633 ++vertical_step_count_; 640 ++vertical_step_count_;
634 ++horizontal_step_count_; 641 ++horizontal_step_count_;
635 } 642 }
636 } 643 }
637 644
638 } // namespace cc 645 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/tiling_data.h ('k') | cc/resources/managed_tile_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698