OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 428 } |
429 | 429 |
430 void WaitForDraw() { | 430 void WaitForDraw() { |
431 DrawWaiterForTest::Wait(compositor()); | 431 DrawWaiterForTest::Wait(compositor()); |
432 } | 432 } |
433 | 433 |
434 // CompositorDelegate overrides. | 434 // CompositorDelegate overrides. |
435 virtual void ScheduleDraw() OVERRIDE { | 435 virtual void ScheduleDraw() OVERRIDE { |
436 DCHECK(!ui::Compositor::WasInitializedWithThread()); | 436 DCHECK(!ui::Compositor::WasInitializedWithThread()); |
437 if (compositor_) { | 437 if (compositor_) { |
438 MessageLoop::current()->PostTask( | 438 base::MessageLoop::current()->PostTask( |
439 FROM_HERE, | 439 FROM_HERE, base::Bind(&Compositor::Draw, compositor_->AsWeakPtr())); |
440 base::Bind(&Compositor::Draw, compositor_->AsWeakPtr())); | |
441 } | 440 } |
442 } | 441 } |
443 | 442 |
444 private: | 443 private: |
445 scoped_ptr<Compositor> compositor_; | 444 scoped_ptr<Compositor> compositor_; |
446 | 445 |
447 DISALLOW_COPY_AND_ASSIGN(LayerWithDelegateTest); | 446 DISALLOW_COPY_AND_ASSIGN(LayerWithDelegateTest); |
448 }; | 447 }; |
449 | 448 |
450 // L1 | 449 // L1 |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 l1->SetOpacity(0.5f); | 1372 l1->SetOpacity(0.5f); |
1374 | 1373 |
1375 // Change l1's cc::Layer. | 1374 // Change l1's cc::Layer. |
1376 l1->SwitchCCLayerForTest(); | 1375 l1->SwitchCCLayerForTest(); |
1377 | 1376 |
1378 // Ensure that the opacity animation completed. | 1377 // Ensure that the opacity animation completed. |
1379 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); | 1378 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); |
1380 } | 1379 } |
1381 | 1380 |
1382 } // namespace ui | 1381 } // namespace ui |
OLD | NEW |