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

Side by Side Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 18796008: Implement shareResources==true in TestWebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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
OLDNEW
« cc/test/test_web_graphics_context_3d.h ('K') | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698