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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index c3c7ca021104ba5f2468b233838d45beee16c845..f9678cc24275041cf8fbb6022f28ff515c32b734 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -173,10 +173,11 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
AppendQuadsData* append_quads_data) {
DCHECK(!needs_post_commit_initialization_);
// The bounds and the pile size may differ if the pile wasn't updated (ie.
- // PictureLayer::Update didn't happen). But that should never be the case if
- // the layer is part of the visible frame, which is why we're appending quads
- // in the first place
- DCHECK_EQ(bounds().ToString(), pile_->tiling_size().ToString());
+ // PictureLayer::Update didn't happen). In that case the pile will be empty.
+ DCHECK_IMPLIES(!pile_->tiling_size().IsEmpty(),
+ bounds() == pile_->tiling_size())
+ << " bounds " << bounds().ToString() << " pile "
+ << pile_->tiling_size().ToString();
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
@@ -468,7 +469,6 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
void PictureLayerImpl::UpdateTiles(const Occlusion& occlusion_in_content_space,
bool resourceless_software_draw) {
- TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTiles");
DCHECK_EQ(1.f, contents_scale_x());
DCHECK_EQ(1.f, contents_scale_y());
@@ -516,9 +516,6 @@ void PictureLayerImpl::UpdateTiles(const Occlusion& occlusion_in_content_space,
void PictureLayerImpl::UpdateTilePriorities(
const Occlusion& occlusion_in_content_space) {
DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings());
-
- TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
-
double current_frame_time_in_seconds =
(layer_tree_impl()->CurrentBeginFrameArgs().frame_time -
base::TimeTicks()).InSecondsF();
@@ -790,7 +787,6 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
}
void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
- TRACE_EVENT0("cc", "SyncFromActiveLayer");
DCHECK(!other->needs_post_commit_initialization_);
DCHECK(other->tilings_);
@@ -1087,9 +1083,6 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ / raster_device_scale_ / raster_source_scale_;
}
- raster_contents_scale_ =
- std::max(raster_contents_scale_, MinimumContentsScale());
-
// If we're not re-rasterizing during animation, rasterize at the maximum
// scale that will occur during the animation, if the maximum scale is
// known. However we want to avoid excessive memory use. If the scale is
@@ -1121,6 +1114,9 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_;
}
+ raster_contents_scale_ =
+ std::max(raster_contents_scale_, MinimumContentsScale());
+
// If this layer would create zero or one tiles at this content scale,
// don't create a low res tiling.
gfx::Size raster_bounds = gfx::ToCeiledSize(
@@ -1138,6 +1134,8 @@ void PictureLayerImpl::RecalculateRasterScales() {
low_res_raster_contents_scale_ = std::max(
raster_contents_scale_ * low_res_factor,
MinimumContentsScale());
+ DCHECK_LE(low_res_raster_contents_scale_, raster_contents_scale_);
+ DCHECK_GE(low_res_raster_contents_scale_, MinimumContentsScale());
}
void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
@@ -1406,8 +1404,6 @@ bool PictureLayerImpl::HasValidTilePriorities() const {
}
bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
- TRACE_EVENT0("cc",
- "PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw");
if (!layer_tree_impl()->IsPendingTree())
return true;
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698