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

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

Issue 260963008: Fixing crash in PictureLayerImpl::MarkVisibleResourcesAsRequired when low-res tiles are disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverting back ImplSidePaintingSettings class and adjusting the code for readability. Created 6 years, 7 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 for (size_t mode_idx = 0; mode_idx < NUM_RASTER_MODES; ++mode_idx) 129 for (size_t mode_idx = 0; mode_idx < NUM_RASTER_MODES; ++mode_idx)
130 state.tile_versions[mode_idx].SetSolidColorForTesting(true); 130 state.tile_versions[mode_idx].SetSolidColorForTesting(true);
131 DCHECK(tile->IsReadyToDraw()); 131 DCHECK(tile->IsReadyToDraw());
132 } 132 }
133 } 133 }
134 134
135 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() { 135 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() {
136 layer_tree_impl()->UpdateDrawProperties(); 136 layer_tree_impl()->UpdateDrawProperties();
137 137
138 if (CanHaveTilings()) { 138 if (CanHaveTilings()) {
139 DCHECK_EQ(tilings()->num_tilings(), 2u); 139 DCHECK_EQ(
140 tilings()->num_tilings(),
141 layer_tree_impl()->settings().create_low_res_tiling ? 2u : 1u);
140 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION); 142 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION);
141 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION);
142 HighResTiling()->CreateAllTilesForTesting(); 143 HighResTiling()->CreateAllTilesForTesting();
143 LowResTiling()->CreateAllTilesForTesting(); 144 if (layer_tree_impl()->settings().create_low_res_tiling) {
145 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION);
146 LowResTiling()->CreateAllTilesForTesting();
147 }
144 } else { 148 } else {
145 DCHECK_EQ(tilings()->num_tilings(), 0u); 149 DCHECK_EQ(tilings()->num_tilings(), 0u);
146 } 150 }
147 } 151 }
148 152
149 } // namespace cc 153 } // namespace cc
OLDNEW
« cc/layers/picture_layer_impl_unittest.cc ('K') | « cc/layers/picture_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698