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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 271533011: cc: Move tiling management out of draw properties calculation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated PictureLayerImplTest.LayerEvictionTileIterator test. 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 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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 needs_post_commit_initialization_ = true; 132 needs_post_commit_initialization_ = true;
133 133
134 // We always need to push properties. 134 // We always need to push properties.
135 // See http://crbug.com/303943 135 // See http://crbug.com/303943
136 needs_push_properties_ = true; 136 needs_push_properties_ = true;
137 } 137 }
138 138
139 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, 139 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
140 AppendQuadsData* append_quads_data) { 140 AppendQuadsData* append_quads_data) {
141 DCHECK(!needs_post_commit_initialization_); 141 DCHECK(!needs_post_commit_initialization_);
142 gfx::Rect rect(visible_content_rect()); 142
143 float max_contents_scale = MaximumTilingContentScale();
144 gfx::Transform scaled_draw_transform = draw_transform();
145 scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale,
146 SK_MScalar1 / max_contents_scale);
147 gfx::Size scaled_content_bounds =
148 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), max_contents_scale));
149
150 gfx::Rect scaled_visible_content_rect =
151 gfx::ScaleToEnclosingRect(visible_content_rect(), max_contents_scale);
152 scaled_visible_content_rect.Intersect(gfx::Rect(scaled_content_bounds));
143 153
144 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState(); 154 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState();
145 PopulateSharedQuadState(shared_quad_state); 155 PopulateSharedQuadStateWithOverrides(shared_quad_state,
enne (OOO) 2014/05/27 21:41:21 I don't think this function adds much. Can you ju
156 scaled_draw_transform,
157 scaled_content_bounds,
158 scaled_visible_content_rect);
159
160 gfx::Rect rect = scaled_visible_content_rect;
146 161
147 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) { 162 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
148 AppendDebugBorderQuad( 163 AppendDebugBorderQuad(
149 quad_sink, 164 quad_sink,
150 shared_quad_state, 165 shared_quad_state,
151 append_quads_data, 166 append_quads_data,
152 DebugColors::DirectPictureBorderColor(), 167 DebugColors::DirectPictureBorderColor(),
153 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); 168 DebugColors::DirectPictureBorderWidth(layer_tree_impl()));
154 169
155 gfx::Rect geometry_rect = rect; 170 gfx::Rect geometry_rect = rect;
156 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); 171 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
157 gfx::Rect visible_geometry_rect = 172 gfx::Rect visible_geometry_rect =
158 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform()); 173 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform());
159 if (visible_geometry_rect.IsEmpty()) 174 if (visible_geometry_rect.IsEmpty())
160 return; 175 return;
161 176
162 gfx::Size texture_size = rect.size(); 177 gfx::Size texture_size = rect.size();
163 gfx::RectF texture_rect = gfx::RectF(texture_size); 178 gfx::RectF texture_rect = gfx::RectF(texture_size);
164 gfx::Rect quad_content_rect = rect; 179 gfx::Rect quad_content_rect = rect;
165 float contents_scale = contents_scale_x(); 180 float contents_scale = max_contents_scale;
166 181
167 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); 182 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create();
168 quad->SetNew(shared_quad_state, 183 quad->SetNew(shared_quad_state,
169 geometry_rect, 184 geometry_rect,
170 opaque_rect, 185 opaque_rect,
171 visible_geometry_rect, 186 visible_geometry_rect,
172 texture_rect, 187 texture_rect,
173 texture_size, 188 texture_size,
174 RGBA_8888, 189 RGBA_8888,
175 quad_content_rect, 190 quad_content_rect,
176 contents_scale, 191 contents_scale,
177 pile_); 192 pile_);
178 quad_sink->Append(quad.PassAs<DrawQuad>()); 193 quad_sink->Append(quad.PassAs<DrawQuad>());
179 append_quads_data->num_missing_tiles++; 194 append_quads_data->num_missing_tiles++;
180 return; 195 return;
181 } 196 }
182 197
183 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); 198 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data);
184 199
185 if (ShowDebugBorders()) { 200 if (ShowDebugBorders()) {
186 for (PictureLayerTilingSet::CoverageIterator iter( 201 for (PictureLayerTilingSet::CoverageIterator iter(
187 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); 202 tilings_.get(), max_contents_scale, rect, ideal_contents_scale_);
188 iter; 203 iter;
189 ++iter) { 204 ++iter) {
190 SkColor color; 205 SkColor color;
191 float width; 206 float width;
192 if (*iter && iter->IsReadyToDraw()) { 207 if (*iter && iter->IsReadyToDraw()) {
193 ManagedTileState::TileVersion::Mode mode = 208 ManagedTileState::TileVersion::Mode mode =
194 iter->GetTileVersionForDrawing().mode(); 209 iter->GetTileVersionForDrawing().mode();
195 if (mode == ManagedTileState::TileVersion::SOLID_COLOR_MODE) { 210 if (mode == ManagedTileState::TileVersion::SOLID_COLOR_MODE) {
196 color = DebugColors::SolidColorTileBorderColor(); 211 color = DebugColors::SolidColorTileBorderColor();
197 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl()); 212 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl());
198 } else if (mode == ManagedTileState::TileVersion::PICTURE_PILE_MODE) { 213 } else if (mode == ManagedTileState::TileVersion::PICTURE_PILE_MODE) {
199 color = DebugColors::PictureTileBorderColor(); 214 color = DebugColors::PictureTileBorderColor();
200 width = DebugColors::PictureTileBorderWidth(layer_tree_impl()); 215 width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
201 } else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) { 216 } else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) {
202 color = DebugColors::HighResTileBorderColor(); 217 color = DebugColors::HighResTileBorderColor();
203 width = DebugColors::HighResTileBorderWidth(layer_tree_impl()); 218 width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
204 } else if (iter->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION) { 219 } else if (iter->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION) {
205 color = DebugColors::LowResTileBorderColor(); 220 color = DebugColors::LowResTileBorderColor();
206 width = DebugColors::LowResTileBorderWidth(layer_tree_impl()); 221 width = DebugColors::LowResTileBorderWidth(layer_tree_impl());
207 } else if (iter->contents_scale() > contents_scale_x()) { 222 } else if (iter->contents_scale() > max_contents_scale) {
208 color = DebugColors::ExtraHighResTileBorderColor(); 223 color = DebugColors::ExtraHighResTileBorderColor();
209 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl()); 224 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl());
210 } else { 225 } else {
211 color = DebugColors::ExtraLowResTileBorderColor(); 226 color = DebugColors::ExtraLowResTileBorderColor();
212 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl()); 227 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl());
213 } 228 }
214 } else { 229 } else {
215 color = DebugColors::MissingTileBorderColor(); 230 color = DebugColors::MissingTileBorderColor();
216 width = DebugColors::MissingTileBorderWidth(layer_tree_impl()); 231 width = DebugColors::MissingTileBorderWidth(layer_tree_impl());
217 } 232 }
(...skipping 10 matching lines...) Expand all
228 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); 243 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>());
229 } 244 }
230 } 245 }
231 246
232 // Keep track of the tilings that were used so that tilings that are 247 // Keep track of the tilings that were used so that tilings that are
233 // unused can be considered for removal. 248 // unused can be considered for removal.
234 std::vector<PictureLayerTiling*> seen_tilings; 249 std::vector<PictureLayerTiling*> seen_tilings;
235 250
236 bool had_checkerboard_quads = false; 251 bool had_checkerboard_quads = false;
237 for (PictureLayerTilingSet::CoverageIterator iter( 252 for (PictureLayerTilingSet::CoverageIterator iter(
238 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); 253 tilings_.get(), max_contents_scale, rect, ideal_contents_scale_);
239 iter; 254 iter;
240 ++iter) { 255 ++iter) {
241 gfx::Rect geometry_rect = iter.geometry_rect(); 256 gfx::Rect geometry_rect = iter.geometry_rect();
242 gfx::Rect visible_geometry_rect = 257 gfx::Rect visible_geometry_rect =
243 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform()); 258 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform());
244 if (visible_geometry_rect.IsEmpty()) 259 if (visible_geometry_rect.IsEmpty())
245 continue; 260 continue;
246 261
247 append_quads_data->visible_content_area += 262 append_quads_data->visible_content_area +=
248 visible_geometry_rect.width() * visible_geometry_rect.height(); 263 visible_geometry_rect.width() * visible_geometry_rect.height();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 374
360 void PictureLayerImpl::DidUnregisterLayer() { 375 void PictureLayerImpl::DidUnregisterLayer() {
361 TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer"); 376 TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer");
362 377
363 layer_needs_to_register_itself_ = true; 378 layer_needs_to_register_itself_ = true;
364 } 379 }
365 380
366 void PictureLayerImpl::UpdateTilePriorities() { 381 void PictureLayerImpl::UpdateTilePriorities() {
367 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); 382 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
368 383
369 DCHECK(!needs_post_commit_initialization_); 384 DoPostCommitInitializationIfNeeded();
370 CHECK(should_update_tile_priorities_); 385 UpdateIdealScales();
386 // TODO(sohanjg): Avoid needlessly update priorities when syncing to a
387 // non-updated tree which will then be updated immediately afterwards.
388 should_update_tile_priorities_ = true;
389 if (CanHaveTilings())
enne (OOO) 2014/05/27 21:41:21 style nit: add {} for multiline bodies
390 ManageTilings(draw_properties().screen_space_transform_is_animating,
391 draw_properties().maximum_animation_contents_scale);
371 392
372 if (layer_needs_to_register_itself_) { 393 if (layer_needs_to_register_itself_) {
373 layer_tree_impl()->tile_manager()->RegisterPictureLayerImpl(this); 394 layer_tree_impl()->tile_manager()->RegisterPictureLayerImpl(this);
374 layer_needs_to_register_itself_ = false; 395 layer_needs_to_register_itself_ = false;
375 } 396 }
376 397
377 if (layer_tree_impl()->device_viewport_valid_for_tile_management()) { 398 if (layer_tree_impl()->device_viewport_valid_for_tile_management()) {
378 visible_rect_for_tile_priority_ = visible_content_rect(); 399 visible_rect_for_tile_priority_ = visible_content_rect();
379 viewport_size_for_tile_priority_ = layer_tree_impl()->DrawViewportSize(); 400 viewport_size_for_tile_priority_ = layer_tree_impl()->DrawViewportSize();
380 screen_space_transform_for_tile_priority_ = screen_space_transform(); 401 screen_space_transform_for_tile_priority_ = screen_space_transform();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 RemoveAllTilings(); 473 RemoveAllTilings();
453 474
454 ResetRasterScale(); 475 ResetRasterScale();
455 476
456 // To avoid an edge case after lost context where the tree is up to date but 477 // To avoid an edge case after lost context where the tree is up to date but
457 // the tilings have not been managed, request an update draw properties 478 // the tilings have not been managed, request an update draw properties
458 // to force tilings to get managed. 479 // to force tilings to get managed.
459 layer_tree_impl()->set_needs_update_draw_properties(); 480 layer_tree_impl()->set_needs_update_draw_properties();
460 } 481 }
461 482
462 void PictureLayerImpl::CalculateContentsScale(
463 float ideal_contents_scale,
464 float device_scale_factor,
465 float page_scale_factor,
466 float maximum_animation_contents_scale,
467 bool animating_transform_to_screen,
468 float* contents_scale_x,
469 float* contents_scale_y,
470 gfx::Size* content_bounds) {
471 DoPostCommitInitializationIfNeeded();
472
473 // This function sets valid raster scales and manages tilings, so tile
474 // priorities can now be updated.
475 should_update_tile_priorities_ = true;
476
477 if (!CanHaveTilings()) {
478 ideal_page_scale_ = page_scale_factor;
479 ideal_device_scale_ = device_scale_factor;
480 ideal_contents_scale_ = ideal_contents_scale;
481 ideal_source_scale_ =
482 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_;
483 *contents_scale_x = ideal_contents_scale_;
484 *contents_scale_y = ideal_contents_scale_;
485 *content_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(),
486 ideal_contents_scale_,
487 ideal_contents_scale_));
488 return;
489 }
490
491 float min_contents_scale = MinimumContentsScale();
492 DCHECK_GT(min_contents_scale, 0.f);
493 float min_page_scale = layer_tree_impl()->min_page_scale_factor();
494 DCHECK_GT(min_page_scale, 0.f);
495 float min_device_scale = 1.f;
496 float min_source_scale =
497 min_contents_scale / min_page_scale / min_device_scale;
498
499 float ideal_page_scale = page_scale_factor;
500 float ideal_device_scale = device_scale_factor;
501 float ideal_source_scale =
502 ideal_contents_scale / ideal_page_scale / ideal_device_scale;
503
504 ideal_contents_scale_ = std::max(ideal_contents_scale, min_contents_scale);
505 ideal_page_scale_ = ideal_page_scale;
506 ideal_device_scale_ = ideal_device_scale;
507 ideal_source_scale_ = std::max(ideal_source_scale, min_source_scale);
508
509 ManageTilings(animating_transform_to_screen,
510 maximum_animation_contents_scale);
511
512 // The content scale and bounds for a PictureLayerImpl is somewhat fictitious.
513 // There are (usually) several tilings at different scales. However, the
514 // content bounds is the (integer!) space in which quads are generated.
515 // In order to guarantee that we can fill this integer space with any set of
516 // tilings (and then map back to floating point texture coordinates), the
517 // contents scale must be at least as large as the largest of the tilings.
518 float max_contents_scale = min_contents_scale;
519 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
520 const PictureLayerTiling* tiling = tilings_->tiling_at(i);
521 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale());
522 }
523
524 *contents_scale_x = max_contents_scale;
525 *contents_scale_y = max_contents_scale;
526 *content_bounds = gfx::ToCeiledSize(
527 gfx::ScaleSize(bounds(), max_contents_scale, max_contents_scale));
528 }
529
530 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { 483 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
531 return pile_->GetFlattenedPicture(); 484 return pile_->GetFlattenedPicture();
532 } 485 }
533 486
534 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, 487 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
535 const gfx::Rect& content_rect) { 488 const gfx::Rect& content_rect) {
536 if (!pile_->CanRaster(tiling->contents_scale(), content_rect)) 489 if (!pile_->CanRaster(tiling->contents_scale(), content_rect))
537 return scoped_refptr<Tile>(); 490 return scoped_refptr<Tile>();
538 491
539 int flags = 0; 492 int flags = 0;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 void PictureLayerImpl::SetIsMask(bool is_mask) { 684 void PictureLayerImpl::SetIsMask(bool is_mask) {
732 if (is_mask_ == is_mask) 685 if (is_mask_ == is_mask)
733 return; 686 return;
734 is_mask_ = is_mask; 687 is_mask_ = is_mask;
735 if (tilings_) 688 if (tilings_)
736 tilings_->RemoveAllTiles(); 689 tilings_->RemoveAllTiles();
737 } 690 }
738 691
739 ResourceProvider::ResourceId PictureLayerImpl::ContentsResourceId() const { 692 ResourceProvider::ResourceId PictureLayerImpl::ContentsResourceId() const {
740 gfx::Rect content_rect(content_bounds()); 693 gfx::Rect content_rect(content_bounds());
741 float scale = contents_scale_x(); 694 float scale = MaximumTilingContentScale();
742 PictureLayerTilingSet::CoverageIterator iter( 695 PictureLayerTilingSet::CoverageIterator iter(
743 tilings_.get(), scale, content_rect, ideal_contents_scale_); 696 tilings_.get(), scale, content_rect, ideal_contents_scale_);
744 697
745 // Mask resource not ready yet. 698 // Mask resource not ready yet.
746 if (!iter || !*iter) 699 if (!iter || !*iter)
747 return 0; 700 return 0;
748 701
749 // Masks only supported if they fit on exactly one tile. 702 // Masks only supported if they fit on exactly one tile.
750 if (iter.geometry_rect() != content_rect) 703 if (iter.geometry_rect() != content_rect)
751 return 0; 704 return 0;
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 } 1248 }
1296 if (tilings_->num_tilings() == 0) 1249 if (tilings_->num_tilings() == 0)
1297 return; 1250 return;
1298 1251
1299 // MarkVisibleResourcesAsRequired depends on having exactly 1 high res 1252 // MarkVisibleResourcesAsRequired depends on having exactly 1 high res
1300 // tiling to mark its tiles as being required for activation. 1253 // tiling to mark its tiles as being required for activation.
1301 DCHECK_EQ(1, tilings_->NumHighResTilings()); 1254 DCHECK_EQ(1, tilings_->NumHighResTilings());
1302 #endif 1255 #endif
1303 } 1256 }
1304 1257
1258 float PictureLayerImpl::MaximumTilingContentScale() const {
1259 float max_contents_scale = MinimumContentsScale();
1260 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
1261 const PictureLayerTiling* tiling = tilings_->tiling_at(i);
1262 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale());
1263 }
1264 return max_contents_scale;
1265 }
1266
1267 void PictureLayerImpl::PopulateSharedQuadStateWithOverrides(
1268 SharedQuadState* state,
1269 gfx::Transform target_space_transform,
1270 gfx::Size content_bounds,
1271 gfx::Rect visible_content_rect) const {
1272 state->SetAll(target_space_transform,
1273 content_bounds,
1274 visible_content_rect,
1275 draw_properties().clip_rect,
1276 draw_properties().is_clipped,
1277 draw_properties().opacity,
1278 blend_mode());
1279 }
1280
1281 void PictureLayerImpl::UpdateIdealScales() {
1282 if (!CanHaveTilings()) {
1283 ideal_page_scale_ = draw_properties().page_scale_factor;
1284 ideal_device_scale_ = draw_properties().device_scale_factor;
1285 ideal_contents_scale_ = draw_properties().ideal_contents_scale;
1286 ideal_source_scale_ =
1287 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_;
1288 return;
1289 }
1290
1291 float min_contents_scale = MinimumContentsScale();
1292 DCHECK_GT(min_contents_scale, 0.f);
1293 float min_page_scale = layer_tree_impl()->min_page_scale_factor();
1294 DCHECK_GT(min_page_scale, 0.f);
1295 float min_device_scale = 1.f;
1296 float min_source_scale =
1297 min_contents_scale / min_page_scale / min_device_scale;
1298
1299 float ideal_page_scale = draw_properties().page_scale_factor;
1300 float ideal_device_scale = draw_properties().device_scale_factor;
1301 float ideal_source_scale = draw_properties().ideal_contents_scale /
1302 ideal_page_scale / ideal_device_scale;
1303 ideal_contents_scale_ =
1304 std::max(draw_properties().ideal_contents_scale, min_contents_scale);
1305 ideal_page_scale_ = draw_properties().page_scale_factor;
1306 ideal_device_scale_ = draw_properties().device_scale_factor;
1307 ideal_source_scale_ = std::max(ideal_source_scale, min_source_scale);
1308 }
1309
1305 void PictureLayerImpl::GetDebugBorderProperties( 1310 void PictureLayerImpl::GetDebugBorderProperties(
1306 SkColor* color, 1311 SkColor* color,
1307 float* width) const { 1312 float* width) const {
1308 *color = DebugColors::TiledContentLayerBorderColor(); 1313 *color = DebugColors::TiledContentLayerBorderColor();
1309 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); 1314 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl());
1310 } 1315 }
1311 1316
1312 void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const { 1317 void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const {
1313 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1318 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1314 LayerImpl::AsValueInto(state); 1319 LayerImpl::AsValueInto(state);
1315 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); 1320 state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
1316 state->SetDouble("geometry_contents_scale", contents_scale_x()); 1321 state->SetDouble("geometry_contents_scale", MaximumTilingContentScale());
1317 state->Set("tilings", tilings_->AsValue().release()); 1322 state->Set("tilings", tilings_->AsValue().release());
1318 state->Set("pictures", pile_->AsValue().release()); 1323 state->Set("pictures", pile_->AsValue().release());
1319 state->Set("invalidation", invalidation_.AsValue().release()); 1324 state->Set("invalidation", invalidation_.AsValue().release());
1320 1325
1321 scoped_ptr<base::ListValue> coverage_tiles(new base::ListValue); 1326 scoped_ptr<base::ListValue> coverage_tiles(new base::ListValue);
1322 for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(), 1327 for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(),
1323 contents_scale_x(), 1328 contents_scale_x(),
1324 gfx::Rect(content_bounds()), 1329 gfx::Rect(content_bounds()),
1325 ideal_contents_scale_); 1330 ideal_contents_scale_);
1326 iter; 1331 iter;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 return iterator_index_ < iterators_.size(); 1575 return iterator_index_ < iterators_.size();
1571 } 1576 }
1572 1577
1573 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1578 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1574 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1579 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1575 return it->get_type() == iteration_stage_ && 1580 return it->get_type() == iteration_stage_ &&
1576 (**it)->required_for_activation() == required_for_activation_; 1581 (**it)->required_for_activation() == required_for_activation_;
1577 } 1582 }
1578 1583
1579 } // namespace cc 1584 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698