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

Side by Side Diff: trunk/src/cc/resources/picture_layer_tiling_set.cc

Issue 13316003: Revert 191364 "cc: Add ‘chromium_code’: 1 to cc.gyp and cc_t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | « trunk/src/cc/quads/draw_quad_unittest.cc ('k') | trunk/src/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
9 namespace cc { 7 namespace cc {
10 8
11 namespace { 9 namespace {
12 10
13 class LargestToSmallestScaleFunctor { 11 class LargestToSmallestScaleFunctor {
14 public: 12 public:
15 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) { 13 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) {
16 return left->contents_scale() > right->contents_scale(); 14 return left->contents_scale() > right->contents_scale();
17 } 15 }
18 }; 16 };
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size(); 126 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size();
129 ++ideal_tiling_) { 127 ++ideal_tiling_) {
130 PictureLayerTiling* tiling = set_->tilings_[ideal_tiling_]; 128 PictureLayerTiling* tiling = set_->tilings_[ideal_tiling_];
131 if (tiling->contents_scale() < ideal_contents_scale_) { 129 if (tiling->contents_scale() < ideal_contents_scale_) {
132 if (ideal_tiling_ > 0) 130 if (ideal_tiling_ > 0)
133 ideal_tiling_--; 131 ideal_tiling_--;
134 break; 132 break;
135 } 133 }
136 } 134 }
137 135
138 DCHECK_LE(set_->tilings_.size(), 136 if (ideal_tiling_ == set_->tilings_.size() && ideal_tiling_ > 0)
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)
143 ideal_tiling_--; 137 ideal_tiling_--;
144 138
145 ++(*this); 139 ++(*this);
146 } 140 }
147 141
148 PictureLayerTilingSet::CoverageIterator::~CoverageIterator() { 142 PictureLayerTilingSet::CoverageIterator::~CoverageIterator() {
149 } 143 }
150 144
151 gfx::Rect PictureLayerTilingSet::CoverageIterator::geometry_rect() const { 145 gfx::Rect PictureLayerTilingSet::CoverageIterator::geometry_rect() const {
152 if (!tiling_iter_) { 146 if (!tiling_iter_) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 307 }
314 308
315 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { 309 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const {
316 scoped_ptr<base::ListValue> state(new base::ListValue()); 310 scoped_ptr<base::ListValue> state(new base::ListValue());
317 for (size_t i = 0; i < tilings_.size(); ++i) 311 for (size_t i = 0; i < tilings_.size(); ++i)
318 state->Append(tilings_[i]->AsValue().release()); 312 state->Append(tilings_[i]->AsValue().release());
319 return state.PassAs<base::Value>(); 313 return state.PassAs<base::Value>();
320 } 314 }
321 315
322 } // namespace cc 316 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/quads/draw_quad_unittest.cc ('k') | trunk/src/cc/resources/picture_pile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698