Commit 0acea6ae authored by enne's avatar enne Committed by Commit bot

cc: Remove UpdateDrawProperties during sync composite

This is redundant with the UpdateDrawProperties that happens during
CommitComplete.  One pixel test was amusingly changing draw properties
after the commit and update, so modify it to do the update earlier.

Review URL: https://codereview.chromium.org/935143002

Cr-Commit-Position: refs/heads/master@{#317115}
parent 5cee41ec
......@@ -63,10 +63,8 @@ scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
return output_surface.Pass();
}
void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) {
LayerTreeImpl* commit_tree =
impl->pending_tree() ? impl->pending_tree() : impl->active_tree();
if (commit_tree->source_frame_number() != 0)
void LayerTreePixelTest::WillActivateTreeOnThread(LayerTreeHostImpl* impl) {
if (impl->sync_tree()->source_frame_number() != 0)
return;
DirectRenderer* renderer = static_cast<DirectRenderer*>(impl->renderer());
......
......@@ -41,7 +41,7 @@ class LayerTreePixelTest : public LayerTreeTest {
~LayerTreePixelTest() override;
scoped_ptr<OutputSurface> CreateOutputSurface() override;
void CommitCompleteOnThread(LayerTreeHostImpl* impl) override;
void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override;
virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest();
......
......@@ -538,16 +538,23 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
if (!needs_update_draw_properties_)
return true;
// For max_texture_size.
// 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.
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",
......
......@@ -532,9 +532,8 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
if (layer_tree_host_impl_->settings().impl_side_painting) {
layer_tree_host_impl_->ActivateSyncTree();
bool update_lcd_text = false;
layer_tree_host_impl_->active_tree()->UpdateDrawProperties(
update_lcd_text);
DCHECK(!layer_tree_host_impl_->active_tree()
->needs_update_draw_properties());
layer_tree_host_impl_->PrepareTiles();
layer_tree_host_impl_->SynchronouslyInitializeAllTiles();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment