| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/delegated_frame_provider.h" | 9 #include "cc/layers/delegated_frame_provider.h" |
| 10 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 class LayerTreeHostContextTestDontUseLostResources | 1083 class LayerTreeHostContextTestDontUseLostResources |
| 1084 : public LayerTreeHostContextTest { | 1084 : public LayerTreeHostContextTest { |
| 1085 public: | 1085 public: |
| 1086 LayerTreeHostContextTestDontUseLostResources() | 1086 LayerTreeHostContextTestDontUseLostResources() |
| 1087 : lost_context_(false) { | 1087 : lost_context_(false) { |
| 1088 context_should_support_io_surface_ = true; | 1088 context_should_support_io_surface_ = true; |
| 1089 | 1089 |
| 1090 child_output_surface_ = FakeOutputSurface::Create3d(); | 1090 child_output_surface_ = FakeOutputSurface::Create3d(); |
| 1091 child_output_surface_->BindToClient(&output_surface_client_); | 1091 child_output_surface_->BindToClient(&output_surface_client_); |
| 1092 child_resource_provider_ = | 1092 child_resource_provider_ = |
| 1093 ResourceProvider::Create(child_output_surface_.get(), NULL, 0, false); | 1093 ResourceProvider::Create(child_output_surface_.get(), |
| 1094 NULL, |
| 1095 0, |
| 1096 false, |
| 1097 1); |
| 1094 } | 1098 } |
| 1095 | 1099 |
| 1096 static void EmptyReleaseCallback(unsigned sync_point, bool lost) {} | 1100 static void EmptyReleaseCallback(unsigned sync_point, bool lost) {} |
| 1097 | 1101 |
| 1098 virtual void SetupTree() OVERRIDE { | 1102 virtual void SetupTree() OVERRIDE { |
| 1099 WebKit::WebGraphicsContext3D* context3d = | 1103 WebKit::WebGraphicsContext3D* context3d = |
| 1100 child_output_surface_->context_provider()->Context3d(); | 1104 child_output_surface_->context_provider()->Context3d(); |
| 1101 | 1105 |
| 1102 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 1106 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 1103 | 1107 |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 EXPECT_FALSE(layer_tree_host); | 1795 EXPECT_FALSE(layer_tree_host); |
| 1792 } | 1796 } |
| 1793 }; | 1797 }; |
| 1794 | 1798 |
| 1795 SINGLE_AND_MULTI_THREAD_TEST_F( | 1799 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1796 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); | 1800 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); |
| 1797 | 1801 |
| 1798 class UIResourceLostTest : public LayerTreeHostContextTest { | 1802 class UIResourceLostTest : public LayerTreeHostContextTest { |
| 1799 public: | 1803 public: |
| 1800 UIResourceLostTest() : time_step_(0) {} | 1804 UIResourceLostTest() : time_step_(0) {} |
| 1805 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 1806 settings->texture_id_allocation_chunk_size = 1; |
| 1807 } |
| 1801 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1808 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
| 1802 virtual void AfterTest() OVERRIDE {} | 1809 virtual void AfterTest() OVERRIDE {} |
| 1803 | 1810 |
| 1804 // This is called on the main thread after each commit and | 1811 // This is called on the main thread after each commit and |
| 1805 // DidActivateTreeOnThread, with the value of time_step_ at the time | 1812 // DidActivateTreeOnThread, with the value of time_step_ at the time |
| 1806 // of the call to DidActivateTreeOnThread. Similar tests will do | 1813 // of the call to DidActivateTreeOnThread. Similar tests will do |
| 1807 // work on the main thread in DidCommit but that is unsuitable because | 1814 // work on the main thread in DidCommit but that is unsuitable because |
| 1808 // the main thread work for these tests must happen after | 1815 // the main thread work for these tests must happen after |
| 1809 // DidActivateTreeOnThread, which happens after DidCommit with impl-side | 1816 // DidActivateTreeOnThread, which happens after DidCommit with impl-side |
| 1810 // painting. | 1817 // painting. |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 protected: | 2290 protected: |
| 2284 FakeContentLayerClient client_; | 2291 FakeContentLayerClient client_; |
| 2285 scoped_refptr<FakeContentLayer> layer_; | 2292 scoped_refptr<FakeContentLayer> layer_; |
| 2286 int num_commits_; | 2293 int num_commits_; |
| 2287 }; | 2294 }; |
| 2288 | 2295 |
| 2289 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 2296 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
| 2290 | 2297 |
| 2291 } // namespace | 2298 } // namespace |
| 2292 } // namespace cc | 2299 } // namespace cc |
| OLD | NEW |