Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 void InitializeSettings(LayerTreeSettings* settings) override { | 1509 void InitializeSettings(LayerTreeSettings* settings) override { |
| 1510 settings->gpu_rasterization_enabled = true; | 1510 settings->gpu_rasterization_enabled = true; |
| 1511 settings->gpu_rasterization_forced = true; | 1511 settings->gpu_rasterization_forced = true; |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { | 1514 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| 1515 if (num_draws_ < 2) { | 1515 if (num_draws_ < 2) { |
| 1516 PostSetNeedsRedrawRectToMainThread(invalid_rect_); | 1516 PostSetNeedsRedrawRectToMainThread(invalid_rect_); |
| 1517 PostSetNeedsCommitToMainThread(); | |
|
danakj
2016/09/27 23:32:17
Oh thanks for the investigation! I have a suggeste
jaydasika
2016/09/27 23:42:58
That + Adding PostSetNeedsCommitToMainThread() to
| |
| 1517 num_draws_++; | 1518 num_draws_++; |
| 1518 } | 1519 } |
| 1519 } | 1520 } |
| 1520 | 1521 |
| 1521 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 1522 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 1522 if (num_draws_ == 2) { | 1523 if (num_draws_ == 2) { |
| 1523 auto* pending_tree = host_impl->pending_tree(); | 1524 auto* pending_tree = host_impl->pending_tree(); |
| 1524 auto* pending_layer_impl = static_cast<FakePictureLayerImpl*>( | 1525 auto* pending_layer_impl = static_cast<FakePictureLayerImpl*>( |
| 1525 pending_tree->root_layer_for_testing()); | 1526 pending_tree->root_layer_for_testing()); |
| 1526 EXPECT_NE(pending_layer_impl, nullptr); | 1527 EXPECT_NE(pending_layer_impl, nullptr); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 1553 private: | 1554 private: |
| 1554 int num_draws_; | 1555 int num_draws_; |
| 1555 const gfx::Size bounds_; | 1556 const gfx::Size bounds_; |
| 1556 const gfx::Rect invalid_rect_; | 1557 const gfx::Rect invalid_rect_; |
| 1557 FakeContentLayerClient client_; | 1558 FakeContentLayerClient client_; |
| 1558 scoped_refptr<FakePictureLayer> root_layer_; | 1559 scoped_refptr<FakePictureLayer> root_layer_; |
| 1559 }; | 1560 }; |
| 1560 | 1561 |
| 1561 // As there's no pending tree in single-threaded case, this test should run | 1562 // As there's no pending tree in single-threaded case, this test should run |
| 1562 // only for multi-threaded case. | 1563 // only for multi-threaded case. |
| 1563 // Disabled because its timing out flakily. crbug.com/598491 | 1564 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged); |
| 1564 // MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged); | |
| 1565 | 1565 |
| 1566 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { | 1566 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { |
| 1567 public: | 1567 public: |
| 1568 void InitializeSettings(LayerTreeSettings* settings) override { | 1568 void InitializeSettings(LayerTreeSettings* settings) override { |
| 1569 settings->layer_transforms_should_scale_layer_contents = true; | 1569 settings->layer_transforms_should_scale_layer_contents = true; |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 void SetupTree() override { | 1572 void SetupTree() override { |
| 1573 root_layer_ = Layer::Create(); | 1573 root_layer_ = Layer::Create(); |
| 1574 root_layer_->SetBounds(gfx::Size(10, 20)); | 1574 root_layer_->SetBounds(gfx::Size(10, 20)); |
| (...skipping 5598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7173 EndTest(); | 7173 EndTest(); |
| 7174 } | 7174 } |
| 7175 | 7175 |
| 7176 void AfterTest() override {} | 7176 void AfterTest() override {} |
| 7177 }; | 7177 }; |
| 7178 | 7178 |
| 7179 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); | 7179 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); |
| 7180 | 7180 |
| 7181 } // namespace | 7181 } // namespace |
| 7182 } // namespace cc | 7182 } // namespace cc |
| OLD | NEW |