OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BLIMP_CLIENT_COMPOSITOR_TEST_DUMMY_LAYER_DRIVER_H_ |
| 6 #define BLIMP_CLIENT_COMPOSITOR_TEST_DUMMY_LAYER_DRIVER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 |
| 12 namespace cc { |
| 13 class Layer; |
| 14 } |
| 15 |
| 16 namespace blimp { |
| 17 |
| 18 // A test class that drives changes to a layer every 16ms. This can be used to |
| 19 // make sure the compositor is rendering layers properly. In this case, colors |
| 20 // are constantly changed over time. |
| 21 class DummyLayerDriver { |
| 22 public: |
| 23 DummyLayerDriver(); |
| 24 virtual ~DummyLayerDriver(); |
| 25 |
| 26 // Adds a cc::SolidColorLayer to |layer| and animates it's color until the |
| 27 // layer is detached from it's cc::LayerTreeHost. |
| 28 void SetParentLayer(scoped_refptr<cc::Layer> layer); |
| 29 |
| 30 private: |
| 31 void StepAnimation(); |
| 32 |
| 33 scoped_refptr<cc::Layer> layer_; |
| 34 bool animation_running_; |
| 35 |
| 36 base::WeakPtrFactory<DummyLayerDriver> weak_factory_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(DummyLayerDriver); |
| 39 }; |
| 40 |
| 41 } // namespace blimp |
| 42 |
| 43 #endif // BLIMP_CLIENT_COMPOSITOR_TEST_DUMMY_LAYER_DRIVER_H_ |
OLD | NEW |