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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 3404c1ea9df6ac49b8570848e524aea5ae2ecccb..d6d501bdd9d75d5746a6e7c5be720d7302a51f2d 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -108,11 +108,11 @@ class LayerTreeHostContextTest : public LayerTreeTest {
}
if (delegating_renderer()) {
- return FakeOutputSurface::CreateDelegating3d(
- context3d.PassAs<WebGraphicsContext3D>()).PassAs<OutputSurface>();
+ return FakeOutputSurface::CreateDelegating3d(context3d.Pass())
+ .PassAs<OutputSurface>();
}
- return FakeOutputSurface::Create3d(
- context3d.PassAs<WebGraphicsContext3D>()).PassAs<OutputSurface>();
+ return FakeOutputSurface::Create3d(context3d.Pass())
+ .PassAs<OutputSurface>();
}
scoped_ptr<TestWebGraphicsContext3D> CreateOffscreenContext3d() {
@@ -141,10 +141,11 @@ class LayerTreeHostContextTest : public LayerTreeTest {
if (!offscreen_contexts_main_thread_.get() ||
offscreen_contexts_main_thread_->DestroyedOnMainThread()) {
- offscreen_contexts_main_thread_ = TestContextProvider::Create(
- base::Bind(&LayerTreeHostContextTest::CreateOffscreenContext3d,
- base::Unretained(this)));
- if (offscreen_contexts_main_thread_.get() &&
+ offscreen_contexts_main_thread_ =
+ TestContextProvider::Create(
+ base::Bind(&LayerTreeHostContextTest::CreateOffscreenContext3d,
+ base::Unretained(this)));
+ if (offscreen_contexts_main_thread_ &&
!offscreen_contexts_main_thread_->BindToCurrentThread())
offscreen_contexts_main_thread_ = NULL;
}
@@ -157,9 +158,10 @@ class LayerTreeHostContextTest : public LayerTreeTest {
if (!offscreen_contexts_compositor_thread_.get() ||
offscreen_contexts_compositor_thread_->DestroyedOnMainThread()) {
- offscreen_contexts_compositor_thread_ = TestContextProvider::Create(
- base::Bind(&LayerTreeHostContextTest::CreateOffscreenContext3d,
- base::Unretained(this)));
+ offscreen_contexts_compositor_thread_ =
+ TestContextProvider::Create(
+ base::Bind(&LayerTreeHostContextTest::CreateOffscreenContext3d,
+ base::Unretained(this)));
}
return offscreen_contexts_compositor_thread_;
}
@@ -1219,6 +1221,10 @@ class LayerTreeHostContextTestDontUseLostResources
LayerTreeHostContextTest::CommitCompleteOnThread(host_impl);
ResourceProvider* resource_provider = host_impl->resource_provider();
+ ContextProvider* context_provider =
+ host_impl->output_surface()->context_provider();
+
+ DCHECK(context_provider);
if (host_impl->active_tree()->source_frame_number() == 0) {
// Set up impl resources on the first commit.
@@ -1255,9 +1261,8 @@ class LayerTreeHostContextTestDontUseLostResources
static_cast<TextureLayerImpl*>(
host_impl->active_tree()->root_layer()->children()[2]);
texture_impl->set_texture_id(
- resource_provider->GraphicsContext3D()->createTexture());
+ context_provider->Context3d()->createTexture());
- DCHECK(resource_provider->GraphicsContext3D());
ResourceProvider::ResourceId texture = resource_provider->CreateResource(
gfx::Size(4, 4),
resource_provider->default_resource_type(),
@@ -1265,9 +1270,8 @@ class LayerTreeHostContextTestDontUseLostResources
ResourceProvider::ScopedWriteLockGL lock(resource_provider, texture);
gpu::Mailbox mailbox;
- resource_provider->GraphicsContext3D()->genMailboxCHROMIUM(mailbox.name);
- unsigned sync_point =
- resource_provider->GraphicsContext3D()->insertSyncPoint();
+ context_provider->Context3d()->genMailboxCHROMIUM(mailbox.name);
+ unsigned sync_point = context_provider->Context3d()->insertSyncPoint();
color_video_frame_ = VideoFrame::CreateColorFrame(
gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698