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

Side by Side Diff: cc/resources/picture_pile.cc

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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_pile.h" 5 #include "cc/resources/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 contents_opaque_ = contents_opaque; 159 contents_opaque_ = contents_opaque;
160 contents_fill_bounds_completely_ = contents_fill_bounds_completely; 160 contents_fill_bounds_completely_ = contents_fill_bounds_completely;
161 161
162 gfx::Rect interest_rect = visible_layer_rect; 162 gfx::Rect interest_rect = visible_layer_rect;
163 interest_rect.Inset( 163 interest_rect.Inset(
164 -kPixelDistanceToRecord, 164 -kPixelDistanceToRecord,
165 -kPixelDistanceToRecord, 165 -kPixelDistanceToRecord,
166 -kPixelDistanceToRecord, 166 -kPixelDistanceToRecord,
167 -kPixelDistanceToRecord); 167 -kPixelDistanceToRecord);
168 recorded_viewport_ = interest_rect; 168 recorded_viewport_ = interest_rect;
169 recorded_viewport_.Intersect(gfx::Rect(size())); 169 recorded_viewport_.Intersect(tiling_rect());
170 170
171 bool invalidated = false; 171 bool invalidated = false;
172 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) { 172 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) {
173 gfx::Rect invalidation = i.rect(); 173 gfx::Rect invalidation = i.rect();
174 // Split this inflated invalidation across tile boundaries and apply it 174 // Split this inflated invalidation across tile boundaries and apply it
175 // to all tiles that it touches. 175 // to all tiles that it touches.
176 bool include_borders = true; 176 bool include_borders = true;
177 for (TilingData::Iterator iter(&tiling_, invalidation, include_borders); 177 for (TilingData::Iterator iter(&tiling_, invalidation, include_borders);
178 iter; 178 iter;
179 ++iter) { 179 ++iter) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 DCHECK(found_tile_for_recorded_picture); 269 DCHECK(found_tile_for_recorded_picture);
270 } 270 }
271 271
272 has_any_recordings_ = true; 272 has_any_recordings_ = true;
273 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); 273 DCHECK(CanRasterSlowTileCheck(recorded_viewport_));
274 return true; 274 return true;
275 } 275 }
276 276
277 } // namespace cc 277 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698