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

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: 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 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 {
237 test_hooks_->WillBeginFrame();
238 }
237 239
238 virtual void DidBeginFrame() OVERRIDE {} 240 virtual void DidBeginFrame() OVERRIDE {}
239 241
240 virtual void Animate(double monotonic_time) OVERRIDE { 242 virtual void Animate(double monotonic_time) OVERRIDE {
241 test_hooks_->Animate(base::TimeTicks::FromInternalValue( 243 test_hooks_->Animate(base::TimeTicks::FromInternalValue(
242 monotonic_time * base::Time::kMicrosecondsPerSecond)); 244 monotonic_time * base::Time::kMicrosecondsPerSecond));
243 } 245 }
244 246
245 virtual void Layout() OVERRIDE { 247 virtual void Layout() OVERRIDE {
246 test_hooks_->Layout(); 248 test_hooks_->Layout();
247 } 249 }
248 250
249 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 251 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
250 float scale) OVERRIDE { 252 float scale) OVERRIDE {
251 test_hooks_->ApplyScrollAndScale(scroll_delta, scale); 253 test_hooks_->ApplyScrollAndScale(scroll_delta, scale);
252 } 254 }
253 255
254 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { 256 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
255 return test_hooks_->CreateOutputSurface(); 257 return test_hooks_->CreateOutputSurface();
256 } 258 }
257 259
258 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE { 260 virtual void DidInitializeOutputSurface(bool succeeded) OVERRIDE {
259 test_hooks_->DidInitializeOutputSurface(succeeded); 261 test_hooks_->DidInitializeOutputSurface(succeeded);
260 } 262 }
261 263
262 virtual void DidFailToInitializeOutputSurface() OVERRIDE { 264 virtual void DidFailToInitializeOutputSurface() OVERRIDE {
263 test_hooks_->DidFailToInitializeOutputSurface(); 265 test_hooks_->DidFailToInitializeOutputSurface();
264 } 266 }
265 267
266 virtual void WillCommit() OVERRIDE {} 268 virtual void WillCommit() OVERRIDE {
269 test_hooks_->WillCommit();
270 }
267 271
268 virtual void DidCommit() OVERRIDE { 272 virtual void DidCommit() OVERRIDE {
269 test_hooks_->DidCommit(); 273 test_hooks_->DidCommit();
270 } 274 }
271 275
272 virtual void DidCommitAndDrawFrame() OVERRIDE { 276 virtual void DidCommitAndDrawFrame() OVERRIDE {
273 test_hooks_->DidCommitAndDrawFrame(); 277 test_hooks_->DidCommitAndDrawFrame();
274 } 278 }
275 279
276 virtual void DidCompleteSwapBuffers() OVERRIDE { 280 virtual void DidCompleteSwapBuffers() OVERRIDE {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 629
626 scoped_refptr<cc::ContextProvider> LayerTreeTest:: 630 scoped_refptr<cc::ContextProvider> LayerTreeTest::
627 OffscreenContextProviderForCompositorThread() { 631 OffscreenContextProviderForCompositorThread() {
628 if (!compositor_thread_contexts_.get() || 632 if (!compositor_thread_contexts_.get() ||
629 compositor_thread_contexts_->DestroyedOnMainThread()) 633 compositor_thread_contexts_->DestroyedOnMainThread())
630 compositor_thread_contexts_ = FakeContextProvider::Create(); 634 compositor_thread_contexts_ = FakeContextProvider::Create();
631 return compositor_thread_contexts_; 635 return compositor_thread_contexts_;
632 } 636 }
633 637
634 } // namespace cc 638 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698