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

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

Issue 62283012: cc: Added tile bundles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.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/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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 float width; 172 float width;
173 if (*iter && iter->IsReadyToDraw()) { 173 if (*iter && iter->IsReadyToDraw()) {
174 ManagedTileState::TileVersion::Mode mode = 174 ManagedTileState::TileVersion::Mode mode =
175 iter->GetTileVersionForDrawing().mode(); 175 iter->GetTileVersionForDrawing().mode();
176 if (mode == ManagedTileState::TileVersion::SOLID_COLOR_MODE) { 176 if (mode == ManagedTileState::TileVersion::SOLID_COLOR_MODE) {
177 color = DebugColors::SolidColorTileBorderColor(); 177 color = DebugColors::SolidColorTileBorderColor();
178 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl()); 178 width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl());
179 } else if (mode == ManagedTileState::TileVersion::PICTURE_PILE_MODE) { 179 } else if (mode == ManagedTileState::TileVersion::PICTURE_PILE_MODE) {
180 color = DebugColors::PictureTileBorderColor(); 180 color = DebugColors::PictureTileBorderColor();
181 width = DebugColors::PictureTileBorderWidth(layer_tree_impl()); 181 width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
182 } else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) { 182 } else if (iter.priority().resolution == HIGH_RESOLUTION) {
183 color = DebugColors::HighResTileBorderColor(); 183 color = DebugColors::HighResTileBorderColor();
184 width = DebugColors::HighResTileBorderWidth(layer_tree_impl()); 184 width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
185 } else if (iter->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION) { 185 } else if (iter.priority().resolution == LOW_RESOLUTION) {
186 color = DebugColors::LowResTileBorderColor(); 186 color = DebugColors::LowResTileBorderColor();
187 width = DebugColors::LowResTileBorderWidth(layer_tree_impl()); 187 width = DebugColors::LowResTileBorderWidth(layer_tree_impl());
188 } else if (iter->contents_scale() > contents_scale_x()) { 188 } else if (iter->contents_scale() > contents_scale_x()) {
189 color = DebugColors::ExtraHighResTileBorderColor(); 189 color = DebugColors::ExtraHighResTileBorderColor();
190 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl()); 190 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl());
191 } else { 191 } else {
192 color = DebugColors::ExtraLowResTileBorderColor(); 192 color = DebugColors::ExtraLowResTileBorderColor();
193 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl()); 193 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl());
194 } 194 }
195 } else { 195 } else {
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 pile_.get(), 484 pile_.get(),
485 content_rect.size(), 485 content_rect.size(),
486 content_rect, 486 content_rect,
487 contents_opaque() ? content_rect : gfx::Rect(), 487 contents_opaque() ? content_rect : gfx::Rect(),
488 tiling->contents_scale(), 488 tiling->contents_scale(),
489 id(), 489 id(),
490 layer_tree_impl()->source_frame_number(), 490 layer_tree_impl()->source_frame_number(),
491 flags); 491 flags);
492 } 492 }
493 493
494 scoped_refptr<TileBundle> PictureLayerImpl::CreateTileBundle(int offset_x,
495 int offset_y,
496 int width,
497 int height) {
498 return layer_tree_impl()->tile_manager()->CreateTileBundle(
499 offset_x, offset_y, width, height);
500 }
501
494 void PictureLayerImpl::UpdatePile(Tile* tile) { 502 void PictureLayerImpl::UpdatePile(Tile* tile) {
495 tile->set_picture_pile(pile_); 503 tile->set_picture_pile(pile_);
496 } 504 }
497 505
498 const Region* PictureLayerImpl::GetInvalidation() { 506 const Region* PictureLayerImpl::GetInvalidation() {
499 return &invalidation_; 507 return &invalidation_;
500 } 508 }
501 509
502 const PictureLayerTiling* PictureLayerImpl::GetTwinTiling( 510 const PictureLayerTiling* PictureLayerImpl::GetTwinTiling(
503 const PictureLayerTiling* tiling) const { 511 const PictureLayerTiling* tiling) const {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 contents_scale_x(), 725 contents_scale_x(),
718 rect); 726 rect);
719 iter; 727 iter;
720 ++iter) { 728 ++iter) {
721 if (!*iter || !iter->IsReadyToDraw()) 729 if (!*iter || !iter->IsReadyToDraw())
722 continue; 730 continue;
723 731
724 // This iteration is over the visible content rect which is potentially 732 // This iteration is over the visible content rect which is potentially
725 // less conservative than projecting the viewport into the layer. 733 // less conservative than projecting the viewport into the layer.
726 // Ignore tiles that are know to be outside the viewport. 734 // Ignore tiles that are know to be outside the viewport.
727 if (iter->priority(PENDING_TREE).distance_to_visible_in_pixels != 0) 735 if (iter.priority().distance_to_visible_in_pixels != 0)
728 continue; 736 continue;
729 737
730 missing_region.Subtract(iter.geometry_rect()); 738 missing_region.Subtract(iter.geometry_rect());
731 iter->MarkRequiredForActivation(); 739 iter->MarkRequiredForActivation();
732 } 740 }
733 } 741 }
734 DCHECK(high_res) << "There must be one high res tiling"; 742 DCHECK(high_res) << "There must be one high res tiling";
735 743
736 // If these pointers are null (because no twin, no matching tiling, or the 744 // If these pointers are null (because no twin, no matching tiling, or the
737 // simpification just below), then high res tiles will be required to fill any 745 // simpification just below), then high res tiles will be required to fill any
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 iter; 794 iter;
787 ++iter) { 795 ++iter) {
788 Tile* tile = *iter; 796 Tile* tile = *iter;
789 // A null tile (i.e. missing recording) can just be skipped. 797 // A null tile (i.e. missing recording) can just be skipped.
790 if (!tile) 798 if (!tile)
791 continue; 799 continue;
792 800
793 // This iteration is over the visible content rect which is potentially 801 // This iteration is over the visible content rect which is potentially
794 // less conservative than projecting the viewport into the layer. 802 // less conservative than projecting the viewport into the layer.
795 // Ignore tiles that are know to be outside the viewport. 803 // Ignore tiles that are know to be outside the viewport.
796 if (tile->priority(PENDING_TREE).distance_to_visible_in_pixels != 0) 804 if (iter.priority().distance_to_visible_in_pixels != 0)
797 continue; 805 continue;
798 806
799 // If the missing region doesn't cover it, this tile is fully 807 // If the missing region doesn't cover it, this tile is fully
800 // covered by acceptable tiles at other scales. 808 // covered by acceptable tiles at other scales.
801 if (!missing_region.Intersects(iter.geometry_rect())) 809 if (!missing_region.Intersects(iter.geometry_rect()))
802 continue; 810 continue;
803 811
804 // If the twin tile doesn't exist (i.e. missing recording or so far away 812 // If the twin tile doesn't exist (i.e. missing recording or so far away
805 // that it is outside the visible tile rect) or this tile is shared between 813 // that it is outside the visible tile rect) or this tile is shared between
806 // with the twin, then this tile isn't required to prevent flashing. 814 // with the twin, then this tile isn't required to prevent flashing.
807 if (optional_twin_tiling) { 815 if (optional_twin_tiling) {
808 Tile* twin_tile = optional_twin_tiling->TileAt(iter.i(), iter.j()); 816 Tile* twin_tile =
817 optional_twin_tiling->TileAt(ACTIVE_TREE, iter.i(), iter.j());
809 if (!twin_tile || twin_tile == tile) { 818 if (!twin_tile || twin_tile == tile) {
810 twin_had_missing_tile = true; 819 twin_had_missing_tile = true;
811 continue; 820 continue;
812 } 821 }
813 } 822 }
814 823
815 tile->MarkRequiredForActivation(); 824 tile->MarkRequiredForActivation();
816 } 825 }
817 return twin_had_missing_tile; 826 return twin_had_missing_tile;
818 } 827 }
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1233 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1225 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1234 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1226 return tilings_->GPUMemoryUsageInBytes(); 1235 return tilings_->GPUMemoryUsageInBytes();
1227 } 1236 }
1228 1237
1229 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1238 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1230 benchmark->RunOnLayer(this); 1239 benchmark->RunOnLayer(this);
1231 } 1240 }
1232 1241
1233 } // namespace cc 1242 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698