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/resources/picture_layer_tiling_set.cc

Issue 13206004: cc: Fix build issues for adding ‘chromium_code’: 1 to cc.gyp and cc_tests.gyp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_tiling_set.h" 5 #include "cc/resources/picture_layer_tiling_set.h"
6 6
7 #include <limits>
8
7 namespace cc { 9 namespace cc {
8 10
9 namespace { 11 namespace {
10 12
11 class LargestToSmallestScaleFunctor { 13 class LargestToSmallestScaleFunctor {
12 public: 14 public:
13 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) { 15 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) {
14 return left->contents_scale() > right->contents_scale(); 16 return left->contents_scale() > right->contents_scale();
15 } 17 }
16 }; 18 };
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size(); 128 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size();
127 ++ideal_tiling_) { 129 ++ideal_tiling_) {
128 PictureLayerTiling* tiling = set_->tilings_[ideal_tiling_]; 130 PictureLayerTiling* tiling = set_->tilings_[ideal_tiling_];
129 if (tiling->contents_scale() < ideal_contents_scale_) { 131 if (tiling->contents_scale() < ideal_contents_scale_) {
130 if (ideal_tiling_ > 0) 132 if (ideal_tiling_ > 0)
131 ideal_tiling_--; 133 ideal_tiling_--;
132 break; 134 break;
133 } 135 }
134 } 136 }
135 137
136 if (ideal_tiling_ == set_->tilings_.size() && ideal_tiling_ > 0) 138 DCHECK_LE(set_->tilings_.size(),
139 static_cast<size_t>(std::numeric_limits<int>::max()));
140
141 int num_tilings = set_->tilings_.size();
142 if (ideal_tiling_ == num_tilings && ideal_tiling_ > 0)
137 ideal_tiling_--; 143 ideal_tiling_--;
138 144
139 ++(*this); 145 ++(*this);
140 } 146 }
141 147
142 PictureLayerTilingSet::Iterator::~Iterator() { 148 PictureLayerTilingSet::Iterator::~Iterator() {
143 } 149 }
144 150
145 gfx::Rect PictureLayerTilingSet::Iterator::geometry_rect() const { 151 gfx::Rect PictureLayerTilingSet::Iterator::geometry_rect() const {
146 if (!tiling_iter_) { 152 if (!tiling_iter_) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 310 }
305 311
306 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { 312 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const {
307 scoped_ptr<base::ListValue> state(new base::ListValue()); 313 scoped_ptr<base::ListValue> state(new base::ListValue());
308 for (size_t i = 0; i < tilings_.size(); ++i) 314 for (size_t i = 0; i < tilings_.size(); ++i)
309 state->Append(tilings_[i]->AsValue().release()); 315 state->Append(tilings_[i]->AsValue().release());
310 return state.PassAs<base::Value>(); 316 return state.PassAs<base::Value>();
311 } 317 }
312 318
313 } // namespace cc 319 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698