OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 for (int i = left; i <= right; ++i) { | 434 for (int i = left; i <= right; ++i) { |
435 UpdatableTile* tile = TileAt(i, j); | 435 UpdatableTile* tile = TileAt(i, j); |
436 DCHECK(tile); // Did SetTexturePriorites get skipped? | 436 DCHECK(tile); // Did SetTexturePriorites get skipped? |
437 // TODO(enne): This should not ever be null. | 437 // TODO(enne): This should not ever be null. |
438 if (!tile) | 438 if (!tile) |
439 continue; | 439 continue; |
440 if (tile->occluded && !ignore_occlusions) | 440 if (tile->occluded && !ignore_occlusions) |
441 continue; | 441 continue; |
442 // TODO(reveman): Decide if partial update should be allowed based on cost | 442 // TODO(reveman): Decide if partial update should be allowed based on cost |
443 // of update. https://bugs.webkit.org/show_bug.cgi?id=77376 | 443 // of update. https://bugs.webkit.org/show_bug.cgi?id=77376 |
444 if (tile->is_dirty() && layer_tree_host() && | 444 if (tile->is_dirty() && |
445 layer_tree_host()->buffered_updates()) { | 445 !layer_tree_host()->AlwaysUsePartialTextureUpdates()) { |
446 // If we get a partial update, we use the same texture, otherwise return | 446 // If we get a partial update, we use the same texture, otherwise return |
447 // the current texture backing, so we don't update visible textures | 447 // the current texture backing, so we don't update visible textures |
448 // non-atomically. If the current backing is in-use, it won't be | 448 // non-atomically. If the current backing is in-use, it won't be |
449 // deleted until after the commit as the texture manager will not allow | 449 // deleted until after the commit as the texture manager will not allow |
450 // deletion or recycling of in-use textures. | 450 // deletion or recycling of in-use textures. |
451 if (TileOnlyNeedsPartialUpdate(tile) && | 451 if (TileOnlyNeedsPartialUpdate(tile) && |
452 layer_tree_host()->RequestPartialTextureUpdate()) { | 452 layer_tree_host()->RequestPartialTextureUpdate()) { |
453 tile->partial_update = true; | 453 tile->partial_update = true; |
454 } else { | 454 } else { |
455 tile->dirty_rect = tiler_->TileRect(tile); | 455 tile->dirty_rect = tiler_->TileRect(tile); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 gfx::Rect prepaint_rect = visible_content_rect(); | 893 gfx::Rect prepaint_rect = visible_content_rect(); |
894 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 894 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
895 -tiler_->tile_size().height() * kPrepaintRows); | 895 -tiler_->tile_size().height() * kPrepaintRows); |
896 gfx::Rect content_rect(content_bounds()); | 896 gfx::Rect content_rect(content_bounds()); |
897 prepaint_rect.Intersect(content_rect); | 897 prepaint_rect.Intersect(content_rect); |
898 | 898 |
899 return prepaint_rect; | 899 return prepaint_rect; |
900 } | 900 } |
901 | 901 |
902 } // namespace cc | 902 } // namespace cc |
OLD | NEW |