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

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: Update raster skewport setting. Rebase and update test context provider to match latest Skia. 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 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after
2937 } 2937 }
2938 } 2938 }
2939 2939
2940 void DeferredInitializeAndRedraw(LayerTreeHostImpl* host_impl) { 2940 void DeferredInitializeAndRedraw(LayerTreeHostImpl* host_impl) {
2941 EXPECT_FALSE(did_initialize_gl_); 2941 EXPECT_FALSE(did_initialize_gl_);
2942 // SetAndInitializeContext3D calls SetNeedsCommit. 2942 // SetAndInitializeContext3D calls SetNeedsCommit.
2943 FakeOutputSurface* fake_output_surface = 2943 FakeOutputSurface* fake_output_surface =
2944 static_cast<FakeOutputSurface*>(host_impl->output_surface()); 2944 static_cast<FakeOutputSurface*>(host_impl->output_surface());
2945 scoped_refptr<TestContextProvider> context_provider = 2945 scoped_refptr<TestContextProvider> context_provider =
2946 TestContextProvider::Create(); // Not bound to thread. 2946 TestContextProvider::Create(); // Not bound to thread.
2947 EXPECT_TRUE( 2947 scoped_refptr<TestContextProvider> worker_context_provider =
2948 fake_output_surface->InitializeAndSetContext3d(context_provider)); 2948 TestContextProvider::Create(); // Not bound to thread.
2949 EXPECT_TRUE(fake_output_surface->InitializeAndSetContext3d(
2950 context_provider, worker_context_provider));
2949 did_initialize_gl_ = true; 2951 did_initialize_gl_ = true;
2950 } 2952 }
2951 2953
2952 void ReleaseGLAndRedraw(LayerTreeHostImpl* host_impl) { 2954 void ReleaseGLAndRedraw(LayerTreeHostImpl* host_impl) {
2953 EXPECT_TRUE(did_initialize_gl_); 2955 EXPECT_TRUE(did_initialize_gl_);
2954 EXPECT_FALSE(did_release_gl_); 2956 EXPECT_FALSE(did_release_gl_);
2955 // ReleaseGL calls SetNeedsCommit. 2957 // ReleaseGL calls SetNeedsCommit.
2956 static_cast<FakeOutputSurface*>(host_impl->output_surface())->ReleaseGL(); 2958 static_cast<FakeOutputSurface*>(host_impl->output_surface())->ReleaseGL();
2957 did_release_gl_ = true; 2959 did_release_gl_ = true;
2958 } 2960 }
(...skipping 3302 matching lines...) Expand 10 before | Expand all | Expand 10 after
6261 6263
6262 void AfterTest() override { EXPECT_TRUE(did_commit_); } 6264 void AfterTest() override { EXPECT_TRUE(did_commit_); }
6263 6265
6264 private: 6266 private:
6265 bool did_commit_; 6267 bool did_commit_;
6266 }; 6268 };
6267 6269
6268 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); 6270 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit);
6269 6271
6270 } // namespace cc 6272 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698