| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "blimp/client/compositor/test/dummy_layer_driver.h" | 5 #include "blimp/client/compositor/test/dummy_layer_driver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/task_runner.h" | 9 #include "base/task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| 11 #include "blimp/client/compositor/blimp_compositor.h" | 11 #include "blimp/client/compositor/blimp_compositor.h" |
| 12 #include "cc/layers/layer.h" | 12 #include "cc/layers/layer.h" |
| 13 #include "cc/layers/layer_settings.h" | 13 #include "cc/layers/layer_settings.h" |
| 14 #include "cc/layers/solid_color_layer.h" | 14 #include "cc/layers/solid_color_layer.h" |
| 15 #include "cc/trees/layer_tree_settings.h" | 15 #include "cc/trees/layer_tree_settings.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 | 17 |
| 18 namespace blimp { | 18 namespace blimp { |
| 19 namespace client { |
| 19 | 20 |
| 20 DummyLayerDriver::DummyLayerDriver() | 21 DummyLayerDriver::DummyLayerDriver() |
| 21 : layer_(cc::SolidColorLayer::Create(BlimpCompositor::LayerSettings())), | 22 : layer_(cc::SolidColorLayer::Create(BlimpCompositor::LayerSettings())), |
| 22 animation_running_(false), | 23 animation_running_(false), |
| 23 weak_factory_(this) { | 24 weak_factory_(this) { |
| 24 layer_->SetIsDrawable(true); | 25 layer_->SetIsDrawable(true); |
| 25 layer_->SetBackgroundColor(SK_ColorBLUE); | 26 layer_->SetBackgroundColor(SK_ColorBLUE); |
| 26 layer_->SetBounds(gfx::Size(300, 300)); | 27 layer_->SetBounds(gfx::Size(300, 300)); |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 (SkColorGetG(color) + 3) % 255, | 53 (SkColorGetG(color) + 3) % 255, |
| 53 (SkColorGetB(color) + 1) % 255); | 54 (SkColorGetB(color) + 1) % 255); |
| 54 layer_->SetBackgroundColor(color); | 55 layer_->SetBackgroundColor(color); |
| 55 | 56 |
| 56 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 57 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 57 FROM_HERE, | 58 FROM_HERE, |
| 58 base::Bind(&DummyLayerDriver::StepAnimation, weak_factory_.GetWeakPtr()), | 59 base::Bind(&DummyLayerDriver::StepAnimation, weak_factory_.GetWeakPtr()), |
| 59 base::TimeDelta::FromMilliseconds(16)); | 60 base::TimeDelta::FromMilliseconds(16)); |
| 60 } | 61 } |
| 61 | 62 |
| 63 } // namespace client |
| 62 } // namespace blimp | 64 } // namespace blimp |
| OLD | NEW |