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

Side by Side Diff: cc/test/fake_picture_layer_impl.cc

Issue 819643004: Cache viewport rect for tile priority in UpdateTiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/fake_picture_layer_impl.h" 5 #include "cc/test/fake_picture_layer_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "cc/resources/tile.h" 8 #include "cc/resources/tile.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 TileRequirementCheck is_tile_required_callback) const { 194 TileRequirementCheck is_tile_required_callback) const {
195 if (!HasValidTilePriorities()) 195 if (!HasValidTilePriorities())
196 return 0; 196 return 0;
197 197
198 if (!tilings_) 198 if (!tilings_)
199 return 0; 199 return 0;
200 200
201 if (visible_rect_for_tile_priority_.IsEmpty()) 201 if (visible_rect_for_tile_priority_.IsEmpty())
202 return 0; 202 return 0;
203 203
204 gfx::Rect rect = GetViewportForTilePriorityInContentSpace(); 204 gfx::Rect rect = viewport_rect_for_tile_priority_in_content_space_;
205 rect.Intersect(visible_rect_for_tile_priority_); 205 rect.Intersect(visible_rect_for_tile_priority_);
206 206
207 size_t count = 0; 207 size_t count = 0;
208 208
209 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 209 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
210 PictureLayerTiling* tiling = tilings_->tiling_at(i); 210 PictureLayerTiling* tiling = tilings_->tiling_at(i);
211 if (tiling->resolution() != HIGH_RESOLUTION && 211 if (tiling->resolution() != HIGH_RESOLUTION &&
212 tiling->resolution() != LOW_RESOLUTION) 212 tiling->resolution() != LOW_RESOLUTION)
213 continue; 213 continue;
214 214
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 return CountTilesRequired( 248 return CountTilesRequired(
249 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); 249 &PictureLayerTiling::IsTileRequiredForDrawIfVisible);
250 } 250 }
251 251
252 void FakePictureLayerImpl::ReleaseResources() { 252 void FakePictureLayerImpl::ReleaseResources() {
253 PictureLayerImpl::ReleaseResources(); 253 PictureLayerImpl::ReleaseResources();
254 ++release_resources_count_; 254 ++release_resources_count_;
255 } 255 }
256 256
257 } // namespace cc 257 } // namespace cc
OLDNEW
« cc/layers/picture_layer_impl.cc ('K') | « cc/test/fake_picture_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698