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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index e86e785732654ce037e16758aa34adf1ed8da73b..4093c425eb19541fc3a05651e0318a13c1313eed 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -534,27 +534,20 @@ void LayerTreeImpl::ClearViewportLayers() {
outer_viewport_scroll_layer_ = NULL;
}
-bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
+bool LayerTreeImpl::UpdateDrawProperties() {
if (!needs_update_draw_properties_)
return true;
- // Calling UpdateDrawProperties must clear this flag, so there can be no
- // early outs before this.
- needs_update_draw_properties_ = false;
-
- // For max_texture_size. When the renderer is re-created in
- // CreateAndSetRenderer, the needs update draw properties flag is set
- // again.
+ // For max_texture_size.
if (!layer_tree_host_impl_->renderer())
return false;
- // Clear this after the renderer early out, as it should still be
- // possible to hit test even without a renderer.
- render_surface_layer_list_.clear();
-
if (!root_layer())
return false;
+ needs_update_draw_properties_ = false;
+ render_surface_layer_list_.clear();
+
{
TRACE_EVENT2(
"cc", "LayerTreeImpl::UpdateDrawProperties::CalculateDrawProperties",
@@ -654,25 +647,6 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
occlusion_tracker.ComputeVisibleRegionInScreen();
}
- // It'd be ideal if this could be done earlier, but when the raster source
- // is updated from the main thread during push properties, update draw
- // properties has not occurred yet and so it's not clear whether or not the
- // layer can or cannot use lcd text. So, this is the cleanup pass to
- // determine if the raster source needs to be replaced with a non-lcd
- // raster source due to draw properties.
- if (update_lcd_text) {
- // TODO(enne): Make LTHI::sync_tree return this value.
- LayerTreeImpl* sync_tree =
- layer_tree_host_impl_->proxy()->CommitToActiveTree()
- ? layer_tree_host_impl_->active_tree()
- : layer_tree_host_impl_->pending_tree();
- // If this is not the sync tree, then it is not safe to update lcd text
- // as it causes invalidations and the tiles may be in use.
- DCHECK_EQ(this, sync_tree);
- for (const auto& layer : picture_layers_)
- layer->UpdateCanUseLCDTextAfterCommit();
- }
-
{
TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles",
"IsActive", IsActiveTree(), "SourceFrameNumber",
@@ -885,10 +859,6 @@ bool LayerTreeImpl::IsRecycleTree() const {
return layer_tree_host_impl_->recycle_tree() == this;
}
-bool LayerTreeImpl::IsSyncTree() const {
- return layer_tree_host_impl_->sync_tree() == this;
-}
-
LayerImpl* LayerTreeImpl::FindActiveTreeLayerById(int id) {
LayerTreeImpl* tree = layer_tree_host_impl_->active_tree();
if (!tree)
@@ -942,7 +912,7 @@ LayerTreeImpl::CreateScrollbarAnimationController(LayerImpl* scrolling_layer) {
base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(settings().scrollbar_fade_duration_ms);
switch (settings().scrollbar_animator) {
- case LayerTreeSettings::LINEAR_FADE: {
+ case LayerTreeSettings::LinearFade: {
return ScrollbarAnimationControllerLinearFade::Create(
scrolling_layer,
layer_tree_host_impl_,
@@ -950,14 +920,14 @@ LayerTreeImpl::CreateScrollbarAnimationController(LayerImpl* scrolling_layer) {
resize_delay,
duration);
}
- case LayerTreeSettings::THINNING: {
+ case LayerTreeSettings::Thinning: {
return ScrollbarAnimationControllerThinning::Create(scrolling_layer,
layer_tree_host_impl_,
delay,
resize_delay,
duration);
}
- case LayerTreeSettings::NO_ANIMATOR:
+ case LayerTreeSettings::NoAnimator:
NOTREACHED();
break;
}
@@ -1191,13 +1161,13 @@ bool LayerTreeImpl::IsUIResourceOpaque(UIResourceId uid) const {
void LayerTreeImpl::ProcessUIResourceRequestQueue() {
for (const auto& req : ui_resource_request_queue_) {
switch (req.GetType()) {
- case UIResourceRequest::UI_RESOURCE_CREATE:
+ case UIResourceRequest::UIResourceCreate:
layer_tree_host_impl_->CreateUIResource(req.GetId(), req.GetBitmap());
break;
- case UIResourceRequest::UI_RESOURCE_DELETE:
+ case UIResourceRequest::UIResourceDelete:
layer_tree_host_impl_->DeleteUIResource(req.GetId());
break;
- case UIResourceRequest::UI_RESOURCE_INVALID_REQUEST:
+ case UIResourceRequest::UIResourceInvalidRequest:
NOTREACHED();
break;
}
@@ -1491,8 +1461,7 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- bool update_lcd_text = false;
- if (!UpdateDrawProperties(update_lcd_text))
+ if (!UpdateDrawProperties())
return NULL;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
FindClosestMatchingLayer(screen_space_point,
@@ -1534,8 +1503,7 @@ LayerImpl* LayerTreeImpl::FindLayerWithWheelHandlerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- bool update_lcd_text = false;
- if (!UpdateDrawProperties(update_lcd_text))
+ if (!UpdateDrawProperties())
return NULL;
FindWheelEventLayerFunctor func;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
@@ -1555,8 +1523,7 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion(
const gfx::PointF& screen_space_point) {
if (!root_layer())
return NULL;
- bool update_lcd_text = false;
- if (!UpdateDrawProperties(update_lcd_text))
+ if (!UpdateDrawProperties())
return NULL;
FindTouchEventLayerFunctor func = {screen_space_point};
FindClosestMatchingLayerDataForRecursion data_for_recursion;
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698