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

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add more comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 // Implementation of LayerTreeHost callback interface. 227 // Implementation of LayerTreeHost callback interface.
228 class LayerTreeHostClientForTesting : public LayerTreeHostClient { 228 class LayerTreeHostClientForTesting : public LayerTreeHostClient {
229 public: 229 public:
230 static scoped_ptr<LayerTreeHostClientForTesting> Create( 230 static scoped_ptr<LayerTreeHostClientForTesting> Create(
231 TestHooks* test_hooks) { 231 TestHooks* test_hooks) {
232 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); 232 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks));
233 } 233 }
234 virtual ~LayerTreeHostClientForTesting() {} 234 virtual ~LayerTreeHostClientForTesting() {}
235 235
236 virtual void WillBeginFrame() OVERRIDE {} 236 virtual void WillBeginFrame() OVERRIDE { test_hooks_->WillBeginFrame(); }
237 237
238 virtual void DidBeginFrame() OVERRIDE {} 238 virtual void DidBeginFrame() OVERRIDE { test_hooks_->DidBeginFrame(); }
239 239
240 virtual void Animate(double monotonic_time) OVERRIDE { 240 virtual void Animate(double monotonic_time) OVERRIDE {
241 test_hooks_->Animate(base::TimeTicks::FromInternalValue( 241 test_hooks_->Animate(base::TimeTicks::FromInternalValue(
242 monotonic_time * base::Time::kMicrosecondsPerSecond)); 242 monotonic_time * base::Time::kMicrosecondsPerSecond));
243 } 243 }
244 244
245 virtual void Layout() OVERRIDE { 245 virtual void Layout() OVERRIDE {
246 test_hooks_->Layout(); 246 test_hooks_->Layout();
247 } 247 }
248 248
249 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 249 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
250 float scale) OVERRIDE { 250 float scale) OVERRIDE {
251 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); 251 test_hooks_->ApplyScrollAndScale(scroll_delta, scale);
252 } 252 }
253 253
254 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { 254 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
255 return test_hooks_->CreateOutputSurface(); 255 return test_hooks_->CreateOutputSurface();
256 } 256 }
257 257
258 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { 258 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE {
259 test_hooks_->DidInitializeOutputSurface(succeeded); 259 test_hooks_->DidInitializeOutputSurface(succeeded);
260 } 260 }
261 261
262 virtual void DidFailToInitializeOutputSurface() OVERRIDE { 262 virtual void DidFailToInitializeOutputSurface() OVERRIDE {
263 test_hooks_->DidFailToInitializeOutputSurface(); 263 test_hooks_->DidFailToInitializeOutputSurface();
264 } 264 }
265 265
266 virtual void WillCommit() OVERRIDE {} 266 virtual void WillCommit() OVERRIDE { test_hooks_->WillCommit(); }
267 267
268 virtual void DidCommit() OVERRIDE { 268 virtual void DidCommit() OVERRIDE {
269 test_hooks_->DidCommit(); 269 test_hooks_->DidCommit();
270 } 270 }
271 271
272 virtual void DidCommitAndDrawFrame() OVERRIDE { 272 virtual void DidCommitAndDrawFrame() OVERRIDE {
273 test_hooks_->DidCommitAndDrawFrame(); 273 test_hooks_->DidCommitAndDrawFrame();
274 } 274 }
275 275
276 virtual void DidCompleteSwapBuffers() OVERRIDE { 276 virtual void DidCompleteSwapBuffers() OVERRIDE {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 623
624 scoped_refptr<cc::ContextProvider> LayerTreeTest:: 624 scoped_refptr<cc::ContextProvider> LayerTreeTest::
625 OffscreenContextProviderForCompositorThread() { 625 OffscreenContextProviderForCompositorThread() {
626 if (!compositor_thread_contexts_.get() || 626 if (!compositor_thread_contexts_.get() ||
627 compositor_thread_contexts_->DestroyedOnMainThread()) 627 compositor_thread_contexts_->DestroyedOnMainThread())
628 compositor_thread_contexts_ = FakeContextProvider::Create(); 628 compositor_thread_contexts_ = FakeContextProvider::Create();
629 return compositor_thread_contexts_; 629 return compositor_thread_contexts_;
630 } 630 }
631 631
632 } // namespace cc 632 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698