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

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

Issue 924213002: cc: Fix DCHECK when impl thread changes scale on a layer being hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: crasher: removetodo Created 5 years, 10 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest_picture.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> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const PictureLayerTilingSet* twin_set, 58 const PictureLayerTilingSet* twin_set,
59 const Region& layer_invalidation, 59 const Region& layer_invalidation,
60 float minimum_contents_scale, 60 float minimum_contents_scale,
61 float maximum_contents_scale) { 61 float maximum_contents_scale) {
62 RemoveTilingsBelowScale(minimum_contents_scale); 62 RemoveTilingsBelowScale(minimum_contents_scale);
63 RemoveTilingsAboveScale(maximum_contents_scale); 63 RemoveTilingsAboveScale(maximum_contents_scale);
64 64
65 // Copy over tilings that are shared with the |twin_set| tiling set (if it 65 // Copy over tilings that are shared with the |twin_set| tiling set (if it
66 // exists). 66 // exists).
67 if (twin_set) { 67 if (twin_set) {
68 if (twin_set->tilings_.empty()) {
69 // If the twin (pending) tiling set is empty, it was not updated for the
70 // current frame. So we drop tilings from our set as well, instead of
71 // leaving behind unshared tilings that are all non-ideal.
72 RemoveAllTilings();
73 }
74
68 for (PictureLayerTiling* twin_tiling : twin_set->tilings_) { 75 for (PictureLayerTiling* twin_tiling : twin_set->tilings_) {
69 float contents_scale = twin_tiling->contents_scale(); 76 float contents_scale = twin_tiling->contents_scale();
70 DCHECK_GE(contents_scale, minimum_contents_scale); 77 DCHECK_GE(contents_scale, minimum_contents_scale);
71 DCHECK_LE(contents_scale, maximum_contents_scale); 78 DCHECK_LE(contents_scale, maximum_contents_scale);
72 79
73 PictureLayerTiling* this_tiling = FindTilingWithScale(contents_scale); 80 PictureLayerTiling* this_tiling = FindTilingWithScale(contents_scale);
74 if (!this_tiling) { 81 if (!this_tiling) {
75 scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create( 82 scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create(
76 contents_scale, raster_source, client_, 83 contents_scale, raster_source, client_,
77 max_tiles_for_interest_area_, skewport_target_time_in_seconds_, 84 max_tiles_for_interest_area_, skewport_target_time_in_seconds_,
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 case LOWER_THAN_LOW_RES: 543 case LOWER_THAN_LOW_RES:
537 range = TilingRange(low_res_range.end, tilings_.size()); 544 range = TilingRange(low_res_range.end, tilings_.size());
538 break; 545 break;
539 } 546 }
540 547
541 DCHECK_LE(range.start, range.end); 548 DCHECK_LE(range.start, range.end);
542 return range; 549 return range;
543 } 550 }
544 551
545 } // namespace cc 552 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest_picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698