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

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

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 } 2935 }
2936 } 2936 }
2937 2937
2938 void DeferredInitializeAndRedraw(LayerTreeHostImpl* host_impl) { 2938 void DeferredInitializeAndRedraw(LayerTreeHostImpl* host_impl) {
2939 EXPECT_FALSE(did_initialize_gl_); 2939 EXPECT_FALSE(did_initialize_gl_);
2940 // SetAndInitializeContext3D calls SetNeedsCommit. 2940 // SetAndInitializeContext3D calls SetNeedsCommit.
2941 FakeOutputSurface* fake_output_surface = 2941 FakeOutputSurface* fake_output_surface =
2942 static_cast<FakeOutputSurface*>(host_impl->output_surface()); 2942 static_cast<FakeOutputSurface*>(host_impl->output_surface());
2943 scoped_refptr<TestContextProvider> context_provider = 2943 scoped_refptr<TestContextProvider> context_provider =
2944 TestContextProvider::Create(); // Not bound to thread. 2944 TestContextProvider::Create(); // Not bound to thread.
2945 EXPECT_TRUE( 2945 scoped_refptr<TestContextProvider> worker_context_provider =
2946 fake_output_surface->InitializeAndSetContext3d(context_provider)); 2946 TestContextProvider::Create(); // Not bound to thread.
2947 EXPECT_TRUE(fake_output_surface->InitializeAndSetContext3d(
2948 context_provider, worker_context_provider));
2947 did_initialize_gl_ = true; 2949 did_initialize_gl_ = true;
2948 } 2950 }
2949 2951
2950 void ReleaseGLAndRedraw(LayerTreeHostImpl* host_impl) { 2952 void ReleaseGLAndRedraw(LayerTreeHostImpl* host_impl) {
2951 EXPECT_TRUE(did_initialize_gl_); 2953 EXPECT_TRUE(did_initialize_gl_);
2952 EXPECT_FALSE(did_release_gl_); 2954 EXPECT_FALSE(did_release_gl_);
2953 // ReleaseGL calls SetNeedsCommit. 2955 // ReleaseGL calls SetNeedsCommit.
2954 static_cast<FakeOutputSurface*>(host_impl->output_surface())->ReleaseGL(); 2956 static_cast<FakeOutputSurface*>(host_impl->output_surface())->ReleaseGL();
2955 did_release_gl_ = true; 2957 did_release_gl_ = true;
2956 } 2958 }
(...skipping 3302 matching lines...) Expand 10 before | Expand all | Expand 10 after
6259 6261
6260 void AfterTest() override { EXPECT_TRUE(did_commit_); } 6262 void AfterTest() override { EXPECT_TRUE(did_commit_); }
6261 6263
6262 private: 6264 private:
6263 bool did_commit_; 6265 bool did_commit_;
6264 }; 6266 };
6265 6267
6266 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); 6268 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit);
6267 6269
6268 } // namespace cc 6270 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698