| 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/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
| 10 #include "cc/layers/io_surface_layer.h" | 10 #include "cc/layers/io_surface_layer.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 media::InitializeMediaLibraryForTesting(); | 66 media::InitializeMediaLibraryForTesting(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void LoseContext() { | 69 void LoseContext() { |
| 70 context3d_->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, | 70 context3d_->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
| 71 GL_INNOCENT_CONTEXT_RESET_ARB); | 71 GL_INNOCENT_CONTEXT_RESET_ARB); |
| 72 context3d_ = NULL; | 72 context3d_ = NULL; |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() { | 75 virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() { |
| 76 return TestWebGraphicsContext3D::Create(); | 76 return TestWebGraphicsContext3D::CreateShared(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { | 79 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { |
| 80 if (times_to_fail_create_) { | 80 if (times_to_fail_create_) { |
| 81 --times_to_fail_create_; | 81 --times_to_fail_create_; |
| 82 ExpectCreateToFail(); | 82 ExpectCreateToFail(); |
| 83 return scoped_ptr<OutputSurface>(); | 83 return scoped_ptr<OutputSurface>(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 scoped_ptr<TestWebGraphicsContext3D> context3d = CreateContext3d(); | 86 scoped_ptr<TestWebGraphicsContext3D> context3d = CreateContext3d(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 ++times_offscreen_created_; | 119 ++times_offscreen_created_; |
| 120 | 120 |
| 121 if (times_to_fail_create_offscreen_) { | 121 if (times_to_fail_create_offscreen_) { |
| 122 --times_to_fail_create_offscreen_; | 122 --times_to_fail_create_offscreen_; |
| 123 ExpectCreateToFail(); | 123 ExpectCreateToFail(); |
| 124 return scoped_ptr<TestWebGraphicsContext3D>(); | 124 return scoped_ptr<TestWebGraphicsContext3D>(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 scoped_ptr<TestWebGraphicsContext3D> offscreen_context3d = | 127 scoped_ptr<TestWebGraphicsContext3D> offscreen_context3d = |
| 128 TestWebGraphicsContext3D::Create().Pass(); | 128 TestWebGraphicsContext3D::CreateShared(); |
| 129 DCHECK(offscreen_context3d); | 129 DCHECK(offscreen_context3d); |
| 130 context3d_->add_share_group_context(offscreen_context3d.get()); | 130 context3d_->add_share_group_context(offscreen_context3d.get()); |
| 131 | 131 |
| 132 return offscreen_context3d.Pass(); | 132 return offscreen_context3d.Pass(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 virtual scoped_refptr<cc::ContextProvider> | 135 virtual scoped_refptr<cc::ContextProvider> |
| 136 OffscreenContextProviderForMainThread() OVERRIDE { | 136 OffscreenContextProviderForMainThread() OVERRIDE { |
| 137 DCHECK(!HasImplThread()); | 137 DCHECK(!HasImplThread()); |
| 138 | 138 |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 impl_thread ? impl_thread->message_loop_proxy() : NULL); | 1597 impl_thread ? impl_thread->message_loop_proxy() : NULL); |
| 1598 EXPECT_FALSE(layer_tree_host); | 1598 EXPECT_FALSE(layer_tree_host); |
| 1599 } | 1599 } |
| 1600 }; | 1600 }; |
| 1601 | 1601 |
| 1602 SINGLE_AND_MULTI_THREAD_TEST_F( | 1602 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1603 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); | 1603 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); |
| 1604 | 1604 |
| 1605 } // namespace | 1605 } // namespace |
| 1606 } // namespace cc | 1606 } // namespace cc |
| OLD | NEW |