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

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

Issue 2899403003: cc: Give non-drawing layers that are rasterized a lower priority. (Closed)
Patch Set: perftest Created 3 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // - This layer produced a high-res or non-ideal-res tile last frame. 508 // - This layer produced a high-res or non-ideal-res tile last frame.
509 // - We're in requires high res to draw mode. 509 // - We're in requires high res to draw mode.
510 // - We're not in smoothness takes priority mode. 510 // - We're not in smoothness takes priority mode.
511 // To put different, the tiling set can't require tiles for activation if 511 // To put different, the tiling set can't require tiles for activation if
512 // we're in smoothness mode and only used low-res or checkerboard to draw last 512 // we're in smoothness mode and only used low-res or checkerboard to draw last
513 // frame and we don't need high res to draw. 513 // frame and we don't need high res to draw.
514 // 514 //
515 // The reason for this is that we should be able to activate sooner and get a 515 // The reason for this is that we should be able to activate sooner and get a
516 // more up to date recording, so we don't run out of recording on the active 516 // more up to date recording, so we don't run out of recording on the active
517 // tree. 517 // tree.
518 bool can_require_tiles_for_activation = 518 // A layer must be a drawing layer for it to require tiles for activation.
519 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() || 519 bool can_require_tiles_for_activation = false;
520 !layer_tree_impl()->SmoothnessTakesPriority(); 520 if (contributes_to_drawn_render_surface()) {
521 can_require_tiles_for_activation =
522 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() ||
523 !layer_tree_impl()->SmoothnessTakesPriority();
524 }
521 525
522 static const Occlusion kEmptyOcclusion; 526 static const Occlusion kEmptyOcclusion;
523 const Occlusion& occlusion_in_content_space = 527 const Occlusion& occlusion_in_content_space =
524 layer_tree_impl()->settings().use_occlusion_for_tile_prioritization 528 layer_tree_impl()->settings().use_occlusion_for_tile_prioritization
525 ? draw_properties().occlusion_in_content_space 529 ? draw_properties().occlusion_in_content_space
526 : kEmptyOcclusion; 530 : kEmptyOcclusion;
527 531
528 // Pass |occlusion_in_content_space| for |occlusion_in_layer_space| since 532 // Pass |occlusion_in_content_space| for |occlusion_in_layer_space| since
529 // they are the same space in picture layer, as contents scale is always 1. 533 // they are the same space in picture layer, as contents scale is always 1.
530 bool updated = tilings_->UpdateTilePriorities( 534 bool updated = tilings_->UpdateTilePriorities(
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 } 1483 }
1480 1484
1481 invalidation_.Union(invalidation); 1485 invalidation_.Union(invalidation);
1482 tilings_->UpdateTilingsForImplSideInvalidation(invalidation); 1486 tilings_->UpdateTilingsForImplSideInvalidation(invalidation);
1483 SetNeedsPushProperties(); 1487 SetNeedsPushProperties();
1484 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", 1488 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages",
1485 "Invalidation", invalidation.ToString()); 1489 "Invalidation", invalidation.ToString());
1486 } 1490 }
1487 1491
1488 } // namespace cc 1492 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698