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

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, 8 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/resources/content_layer_updater.cc ('k') | cc/resources/picture_pile.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 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::CoverageIterator::~CoverageIterator() { 148 PictureLayerTilingSet::CoverageIterator::~CoverageIterator() {
143 } 149 }
144 150
145 gfx::Rect PictureLayerTilingSet::CoverageIterator::geometry_rect() const { 151 gfx::Rect PictureLayerTilingSet::CoverageIterator::geometry_rect() const {
146 if (!tiling_iter_) { 152 if (!tiling_iter_) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 313 }
308 314
309 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { 315 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const {
310 scoped_ptr<base::ListValue> state(new base::ListValue()); 316 scoped_ptr<base::ListValue> state(new base::ListValue());
311 for (size_t i = 0; i < tilings_.size(); ++i) 317 for (size_t i = 0; i < tilings_.size(); ++i)
312 state->Append(tilings_[i]->AsValue().release()); 318 state->Append(tilings_[i]->AsValue().release());
313 return state.PassAs<base::Value>(); 319 return state.PassAs<base::Value>();
314 } 320 }
315 321
316 } // namespace cc 322 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/content_layer_updater.cc ('k') | cc/resources/picture_pile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698