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

Unified 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: review Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 39c0cb9e9d1dc01bd898583ec5b5de74078cfa67..7e7666fba5a6a76fd875d5207001ba902704441d 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -179,10 +179,10 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
} else if (mode == ManagedTileState::TileVersion::PICTURE_PILE_MODE) {
color = DebugColors::PictureTileBorderColor();
width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
- } else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) {
+ } else if (iter.priority().resolution == HIGH_RESOLUTION) {
color = DebugColors::HighResTileBorderColor();
width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
- } else if (iter->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION) {
+ } else if (iter.priority().resolution == LOW_RESOLUTION) {
color = DebugColors::LowResTileBorderColor();
width = DebugColors::LowResTileBorderWidth(layer_tree_impl());
} else if (iter->contents_scale() > contents_scale_x()) {
@@ -479,6 +479,11 @@ scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
is_using_lcd_text_);
}
+scoped_refptr<TileBundle> PictureLayerImpl::CreateTileBundle(
+ gfx::Rect bundle_rect) {
+ return layer_tree_impl()->tile_manager()->CreateTileBundle(bundle_rect);
+}
+
void PictureLayerImpl::UpdatePile(Tile* tile) {
tile->set_picture_pile(pile_);
}
@@ -499,6 +504,14 @@ const PictureLayerTiling* PictureLayerImpl::GetTwinTiling(
return NULL;
}
+bool PictureLayerImpl::IsActive() const {
enne (OOO) 2013/11/27 01:38:05 What did you think about my suggestion to remove t
vmpstr 2013/11/27 21:09:36 Sorry, I thought I replied to this one. I don't mi
enne (OOO) 2013/11/27 22:21:15 You could set the tiling to be pending when it bec
+ return layer_tree_impl()->IsActiveTree();
+}
+
+bool PictureLayerImpl::IsPending() const {
+ return layer_tree_impl()->IsPendingTree();
+}
+
gfx::Size PictureLayerImpl::CalculateTileSize(
gfx::Size content_bounds) const {
if (is_mask_) {
@@ -712,7 +725,7 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const {
// This iteration is over the visible content rect which is potentially
// less conservative than projecting the viewport into the layer.
// Ignore tiles that are know to be outside the viewport.
- if (iter->priority(PENDING_TREE).distance_to_visible_in_pixels != 0)
+ if (iter.priority().distance_to_visible_in_pixels != 0)
continue;
missing_region.Subtract(iter.geometry_rect());
@@ -762,6 +775,8 @@ bool PictureLayerImpl::MarkVisibleTilesAsRequired(
float contents_scale,
gfx::Rect rect,
Region* missing_region) const {
+ DCHECK(layer_tree_impl()->IsPendingTree());
+
bool twin_had_missing_tile = false;
for (PictureLayerTiling::CoverageIterator iter(tiling,
contents_scale,
@@ -776,7 +791,7 @@ bool PictureLayerImpl::MarkVisibleTilesAsRequired(
// This iteration is over the visible content rect which is potentially
// less conservative than projecting the viewport into the layer.
// Ignore tiles that are know to be outside the viewport.
- if (tile->priority(PENDING_TREE).distance_to_visible_in_pixels != 0)
+ if (iter.priority().distance_to_visible_in_pixels != 0)
continue;
// If the missing region doesn't cover it, this tile is fully
@@ -787,7 +802,8 @@ bool PictureLayerImpl::MarkVisibleTilesAsRequired(
// If the twin tile isn't ready to draw, then this tile isn't
// required to prevent flashing.
if (optional_twin_tiling) {
- Tile* twin_tile = optional_twin_tiling->TileAt(iter.i(), iter.j());
+ Tile* twin_tile =
+ optional_twin_tiling->TileAt(ACTIVE_TREE, iter.i(), iter.j());
if (!twin_tile || !twin_tile->IsReadyToDraw()) {
twin_had_missing_tile = true;
continue;

Powered by Google App Engine
This is Rietveld 408576698