danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "cc/test/layer_tree_test.h" |
| 6 | |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 7 | #include "base/command_line.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 8 | #include "cc/animation/animation.h" |
| 9 | #include "cc/animation/animation_registrar.h" |
| 10 | #include "cc/animation/layer_animation_controller.h" |
| 11 | #include "cc/animation/timing_function.h" |
vollick@chromium.org | 8309341c | 2013-04-29 21:11:31 | [diff] [blame] | 12 | #include "cc/base/switches.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 13 | #include "cc/input/input_handler.h" |
| 14 | #include "cc/layers/content_layer.h" |
| 15 | #include "cc/layers/layer.h" |
| 16 | #include "cc/layers/layer_impl.h" |
| 17 | #include "cc/test/animation_test_common.h" |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 18 | #include "cc/test/begin_frame_args_test.h" |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 19 | #include "cc/test/fake_external_begin_frame_source.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 20 | #include "cc/test/fake_layer_tree_host_client.h" |
| 21 | #include "cc/test/fake_output_surface.h" |
jamesr@chromium.org | c2610b9f | 2013-10-31 06:54:59 | [diff] [blame] | 22 | #include "cc/test/test_context_provider.h" |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 23 | #include "cc/test/test_gpu_memory_buffer_manager.h" |
jbauman@chromium.org | 4e2eb35 | 2014-03-20 17:25:45 | [diff] [blame] | 24 | #include "cc/test/test_shared_bitmap_manager.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 25 | #include "cc/test/tiled_layer_test_common.h" |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 26 | #include "cc/trees/layer_tree_host_client.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 27 | #include "cc/trees/layer_tree_host_impl.h" |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 28 | #include "cc/trees/layer_tree_host_single_thread_client.h" |
enne@chromium.org | 98ea818e | 2014-01-24 10:22:08 | [diff] [blame] | 29 | #include "cc/trees/layer_tree_impl.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 30 | #include "cc/trees/single_thread_proxy.h" |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 31 | #include "cc/trees/thread_proxy.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 32 | #include "testing/gmock/include/gmock/gmock.h" |
brianderson@chromium.org | de2cf8c | 2013-10-25 19:46:46 | [diff] [blame] | 33 | #include "ui/gfx/frame_time.h" |
heejin.r.chung | d28506ba | 2014-10-23 16:36:20 | [diff] [blame] | 34 | #include "ui/gfx/geometry/size_conversions.h" |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 35 | |
| 36 | namespace cc { |
| 37 | |
danakj@chromium.org | 4145d17 | 2013-05-10 16:54:36 | [diff] [blame] | 38 | TestHooks::TestHooks() {} |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 39 | |
| 40 | TestHooks::~TestHooks() {} |
| 41 | |
simonhong@chromium.org | 30d8214 | 2014-05-12 04:26:02 | [diff] [blame] | 42 | DrawResult TestHooks::PrepareToDrawOnThread( |
enne@chromium.org | 7ddfe7e8 | 2014-01-30 07:22:11 | [diff] [blame] | 43 | LayerTreeHostImpl* host_impl, |
| 44 | LayerTreeHostImpl::FrameData* frame_data, |
simonhong@chromium.org | 30d8214 | 2014-05-12 04:26:02 | [diff] [blame] | 45 | DrawResult draw_result) { |
enne@chromium.org | 7ddfe7e8 | 2014-01-30 07:22:11 | [diff] [blame] | 46 | return draw_result; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 47 | } |
| 48 | |
vmiura | a30e1ea | 2014-12-09 19:23:51 | [diff] [blame] | 49 | void TestHooks::CreateResourceAndTileTaskWorkerPool( |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 50 | LayerTreeHostImpl* host_impl, |
vmiura | a30e1ea | 2014-12-09 19:23:51 | [diff] [blame] | 51 | scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 52 | scoped_ptr<ResourcePool>* resource_pool, |
| 53 | scoped_ptr<ResourcePool>* staging_resource_pool) { |
vmiura | a30e1ea | 2014-12-09 19:23:51 | [diff] [blame] | 54 | host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
| 55 | tile_task_worker_pool, resource_pool, staging_resource_pool); |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 56 | } |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 57 | |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 58 | // Adapts ThreadProxy for test. Injects test hooks for testing. |
| 59 | class ThreadProxyForTest : public ThreadProxy { |
| 60 | public: |
| 61 | static scoped_ptr<Proxy> Create( |
| 62 | TestHooks* test_hooks, |
| 63 | LayerTreeHost* host, |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 64 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 65 | scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 66 | scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 67 | return make_scoped_ptr(new ThreadProxyForTest( |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 68 | test_hooks, |
| 69 | host, |
| 70 | main_task_runner, |
| 71 | impl_task_runner, |
| 72 | external_begin_frame_source.Pass())); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 73 | } |
| 74 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 75 | ~ThreadProxyForTest() override {} |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 76 | |
| 77 | void test() { |
| 78 | test_hooks_->Layout(); |
| 79 | } |
| 80 | |
| 81 | private: |
| 82 | TestHooks* test_hooks_; |
| 83 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 84 | void ScheduledActionSendBeginMainFrame() override { |
danakj@chromium.org | 92218694 | 2014-06-11 16:30:35 | [diff] [blame] | 85 | test_hooks_->ScheduledActionWillSendBeginMainFrame(); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 86 | ThreadProxy::ScheduledActionSendBeginMainFrame(); |
| 87 | test_hooks_->ScheduledActionSendBeginMainFrame(); |
mithro@mithis.com | 9e54b0cf | 2014-06-19 21:16:48 | [diff] [blame] | 88 | } |
| 89 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 90 | DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
mithro@mithis.com | 9e54b0cf | 2014-06-19 21:16:48 | [diff] [blame] | 91 | DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); |
| 92 | test_hooks_->ScheduledActionDrawAndSwapIfPossible(); |
| 93 | return result; |
| 94 | } |
| 95 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 96 | void ScheduledActionAnimate() override { |
mithro@mithis.com | 9e54b0cf | 2014-06-19 21:16:48 | [diff] [blame] | 97 | ThreadProxy::ScheduledActionAnimate(); |
| 98 | test_hooks_->ScheduledActionAnimate(); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 99 | } |
| 100 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 101 | void ScheduledActionCommit() override { |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 102 | ThreadProxy::ScheduledActionCommit(); |
| 103 | test_hooks_->ScheduledActionCommit(); |
| 104 | } |
| 105 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 106 | void ScheduledActionBeginOutputSurfaceCreation() override { |
mithro@mithis.com | 9e54b0cf | 2014-06-19 21:16:48 | [diff] [blame] | 107 | ThreadProxy::ScheduledActionBeginOutputSurfaceCreation(); |
| 108 | test_hooks_->ScheduledActionBeginOutputSurfaceCreation(); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 109 | } |
| 110 | |
vmiura | 59ea9b404 | 2014-12-09 20:50:39 | [diff] [blame] | 111 | void ScheduledActionPrepareTiles() override { |
| 112 | ThreadProxy::ScheduledActionPrepareTiles(); |
| 113 | test_hooks_->ScheduledActionPrepareTiles(); |
vmpstr | edb488e | 2014-12-03 16:10:06 | [diff] [blame] | 114 | } |
| 115 | |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 116 | ThreadProxyForTest( |
| 117 | TestHooks* test_hooks, |
| 118 | LayerTreeHost* host, |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 119 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 120 | scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 121 | scoped_ptr<BeginFrameSource> external_begin_frame_source) |
| 122 | : ThreadProxy(host, main_task_runner, |
| 123 | impl_task_runner, |
| 124 | external_begin_frame_source.Pass()), |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 125 | test_hooks_(test_hooks) {} |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 126 | }; |
brianderson@chromium.org | d9fce672 | 2013-08-30 01:10:01 | [diff] [blame] | 127 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 128 | // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. |
| 129 | class LayerTreeHostImplForTesting : public LayerTreeHostImpl { |
| 130 | public: |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 131 | static scoped_ptr<LayerTreeHostImplForTesting> Create( |
| 132 | TestHooks* test_hooks, |
| 133 | const LayerTreeSettings& settings, |
| 134 | LayerTreeHostImplClient* host_impl_client, |
egraether@chromium.org | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 135 | Proxy* proxy, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 136 | SharedBitmapManager* shared_bitmap_manager, |
reveman | f9a8a23 | 2014-10-28 17:54:52 | [diff] [blame] | 137 | gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
egraether@chromium.org | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 138 | RenderingStatsInstrumentation* stats_instrumentation) { |
jbauman@chromium.org | 4e2eb35 | 2014-03-20 17:25:45 | [diff] [blame] | 139 | return make_scoped_ptr( |
| 140 | new LayerTreeHostImplForTesting(test_hooks, |
| 141 | settings, |
| 142 | host_impl_client, |
| 143 | proxy, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 144 | shared_bitmap_manager, |
| 145 | gpu_memory_buffer_manager, |
jbauman@chromium.org | 4e2eb35 | 2014-03-20 17:25:45 | [diff] [blame] | 146 | stats_instrumentation)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | protected: |
egraether@chromium.org | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 150 | LayerTreeHostImplForTesting( |
| 151 | TestHooks* test_hooks, |
| 152 | const LayerTreeSettings& settings, |
| 153 | LayerTreeHostImplClient* host_impl_client, |
| 154 | Proxy* proxy, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 155 | SharedBitmapManager* shared_bitmap_manager, |
reveman | f9a8a23 | 2014-10-28 17:54:52 | [diff] [blame] | 156 | gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
egraether@chromium.org | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 157 | RenderingStatsInstrumentation* stats_instrumentation) |
| 158 | : LayerTreeHostImpl(settings, |
| 159 | host_impl_client, |
| 160 | proxy, |
jbauman@chromium.org | a7f3568 | 2013-10-22 23:05:57 | [diff] [blame] | 161 | stats_instrumentation, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 162 | shared_bitmap_manager, |
| 163 | gpu_memory_buffer_manager, |
caseq@chromium.org | dbe759a | 2013-12-02 19:23:02 | [diff] [blame] | 164 | 0), |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 165 | test_hooks_(test_hooks), |
| 166 | block_notify_ready_to_activate_for_testing_(false), |
| 167 | notify_ready_to_activate_was_blocked_(false) {} |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 168 | |
vmiura | a30e1ea | 2014-12-09 19:23:51 | [diff] [blame] | 169 | void CreateResourceAndTileTaskWorkerPool( |
| 170 | scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 171 | scoped_ptr<ResourcePool>* resource_pool, |
| 172 | scoped_ptr<ResourcePool>* staging_resource_pool) override { |
vmiura | a30e1ea | 2014-12-09 19:23:51 | [diff] [blame] | 173 | test_hooks_->CreateResourceAndTileTaskWorkerPool( |
| 174 | this, tile_task_worker_pool, resource_pool, staging_resource_pool); |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 175 | } |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 176 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 177 | void WillBeginImplFrame(const BeginFrameArgs& args) override { |
brianderson@chromium.org | 97e9ccd6 | 2014-04-12 01:07:15 | [diff] [blame] | 178 | LayerTreeHostImpl::WillBeginImplFrame(args); |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 179 | test_hooks_->WillBeginImplFrameOnThread(this, args); |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 180 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 181 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 182 | void BeginMainFrameAborted(bool did_handle) override { |
brianderson@chromium.org | 097a0cbf | 2013-12-12 17:04:58 | [diff] [blame] | 183 | LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
| 184 | test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
| 185 | } |
| 186 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 187 | void BeginCommit() override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 188 | LayerTreeHostImpl::BeginCommit(); |
| 189 | test_hooks_->BeginCommitOnThread(this); |
| 190 | } |
| 191 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 192 | void CommitComplete() override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 193 | LayerTreeHostImpl::CommitComplete(); |
alokp@chromium.org | b606106 | 2014-06-27 19:20:08 | [diff] [blame] | 194 | test_hooks_->CommitCompleteOnThread(this); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 195 | } |
| 196 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 197 | DrawResult PrepareToDraw(FrameData* frame) override { |
danakj@chromium.org | 2aae9679 | 2014-05-15 23:10:50 | [diff] [blame] | 198 | DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); |
enne@chromium.org | 7ddfe7e8 | 2014-01-30 07:22:11 | [diff] [blame] | 199 | return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 200 | } |
| 201 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 202 | void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time) override { |
ccameron@chromium.org | 2e316b27 | 2014-07-19 05:01:20 | [diff] [blame] | 203 | LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 204 | test_hooks_->DrawLayersOnThread(this); |
| 205 | } |
| 206 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 207 | bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override { |
danakj@chromium.org | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 208 | bool result = LayerTreeHostImpl::SwapBuffers(frame); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 209 | test_hooks_->SwapBuffersOnThread(this, result); |
| 210 | return result; |
| 211 | } |
| 212 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 213 | void DidSwapBuffersComplete() override { |
brianderson@chromium.org | c1490266 | 2014-04-18 05:06:11 | [diff] [blame] | 214 | LayerTreeHostImpl::DidSwapBuffersComplete(); |
piman@chromium.org | 2ae13edf | 2013-05-08 16:02:38 | [diff] [blame] | 215 | test_hooks_->SwapBuffersCompleteOnThread(this); |
| 216 | } |
| 217 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 218 | void ReclaimResources(const CompositorFrameAck* ack) override { |
jbauman@chromium.org | a7335e0b | 2013-09-18 09:34:51 | [diff] [blame] | 219 | LayerTreeHostImpl::ReclaimResources(ack); |
| 220 | } |
| 221 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 222 | void NotifyReadyToActivate() override { |
ernstm | dfac03e | 2014-11-11 20:18:05 | [diff] [blame] | 223 | if (block_notify_ready_to_activate_for_testing_) { |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 224 | notify_ready_to_activate_was_blocked_ = true; |
ernstm | dfac03e | 2014-11-11 20:18:05 | [diff] [blame] | 225 | } else { |
danakj | a819c255 | 2014-11-14 02:05:04 | [diff] [blame] | 226 | LayerTreeHostImpl::NotifyReadyToActivate(); |
ernstm | dfac03e | 2014-11-11 20:18:05 | [diff] [blame] | 227 | test_hooks_->NotifyReadyToActivateOnThread(this); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | void NotifyReadyToDraw() override { |
danakj | a819c255 | 2014-11-14 02:05:04 | [diff] [blame] | 232 | LayerTreeHostImpl::NotifyReadyToDraw(); |
ernstm | dfac03e | 2014-11-11 20:18:05 | [diff] [blame] | 233 | test_hooks_->NotifyReadyToDrawOnThread(this); |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 234 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 235 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 236 | void BlockNotifyReadyToActivateForTesting(bool block) override { |
enne | 98f3a6c | 2014-10-09 20:09:44 | [diff] [blame] | 237 | CHECK(settings().impl_side_painting); |
| 238 | CHECK(proxy()->ImplThreadTaskRunner()) |
| 239 | << "Not supported for single-threaded mode."; |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 240 | block_notify_ready_to_activate_for_testing_ = block; |
| 241 | if (!block && notify_ready_to_activate_was_blocked_) { |
| 242 | NotifyReadyToActivate(); |
| 243 | notify_ready_to_activate_was_blocked_ = false; |
| 244 | } |
enne@chromium.org | 94bf75c | 2013-06-12 13:20:04 | [diff] [blame] | 245 | } |
| 246 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 247 | void ActivateSyncTree() override { |
enne@chromium.org | 94bf75c | 2013-06-12 13:20:04 | [diff] [blame] | 248 | test_hooks_->WillActivateTreeOnThread(this); |
alokp@chromium.org | fc20d14 | 2014-07-01 00:49:15 | [diff] [blame] | 249 | LayerTreeHostImpl::ActivateSyncTree(); |
enne@chromium.org | 94bf75c | 2013-06-12 13:20:04 | [diff] [blame] | 250 | DCHECK(!pending_tree()); |
| 251 | test_hooks_->DidActivateTreeOnThread(this); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 252 | } |
| 253 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 254 | bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface) override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 255 | bool success = LayerTreeHostImpl::InitializeRenderer(output_surface.Pass()); |
| 256 | test_hooks_->InitializedRendererOnThread(this, success); |
| 257 | return success; |
| 258 | } |
| 259 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 260 | void SetVisible(bool visible) override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 261 | LayerTreeHostImpl::SetVisible(visible); |
| 262 | test_hooks_->DidSetVisibleOnImplTree(this, visible); |
| 263 | } |
| 264 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 265 | void AnimateLayers(base::TimeTicks monotonic_time) override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 266 | test_hooks_->WillAnimateLayers(this, monotonic_time); |
mithro@mithis.com | 2715264 | 2014-03-11 20:42:00 | [diff] [blame] | 267 | LayerTreeHostImpl::AnimateLayers(monotonic_time); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 268 | test_hooks_->AnimateLayers(this, monotonic_time); |
| 269 | } |
| 270 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 271 | void UpdateAnimationState(bool start_ready_animations) override { |
danakj@chromium.org | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 272 | LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 273 | bool has_unfinished_animation = false; |
| 274 | AnimationRegistrar::AnimationControllerMap::const_iterator iter = |
| 275 | active_animation_controllers().begin(); |
| 276 | for (; iter != active_animation_controllers().end(); ++iter) { |
| 277 | if (iter->second->HasActiveAnimation()) { |
| 278 | has_unfinished_animation = true; |
| 279 | break; |
| 280 | } |
| 281 | } |
| 282 | test_hooks_->UpdateAnimationState(this, has_unfinished_animation); |
danakj | a819c255 | 2014-11-14 02:05:04 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | void NotifyTileStateChanged(const Tile* tile) override { |
| 286 | LayerTreeHostImpl::NotifyTileStateChanged(tile); |
| 287 | test_hooks_->NotifyTileStateChangedOnThread(this, tile); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | private: |
| 291 | TestHooks* test_hooks_; |
brianderson@chromium.org | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 292 | bool block_notify_ready_to_activate_for_testing_; |
| 293 | bool notify_ready_to_activate_was_blocked_; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 294 | }; |
| 295 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 296 | // Implementation of LayerTreeHost callback interface. |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 297 | class LayerTreeHostClientForTesting : public LayerTreeHostClient, |
| 298 | public LayerTreeHostSingleThreadClient { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 299 | public: |
| 300 | static scoped_ptr<LayerTreeHostClientForTesting> Create( |
| 301 | TestHooks* test_hooks) { |
| 302 | return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); |
| 303 | } |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 304 | ~LayerTreeHostClientForTesting() override {} |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 305 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 306 | void WillBeginMainFrame(int frame_id) override { |
dominikg@chromium.org | daea3d4 | 2013-10-23 17:04:50 | [diff] [blame] | 307 | test_hooks_->WillBeginMainFrame(); |
| 308 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 309 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 310 | void DidBeginMainFrame() override { test_hooks_->DidBeginMainFrame(); } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 311 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 312 | void BeginMainFrame(const BeginFrameArgs& args) override { |
skyostil@chromium.org | 04c5900d | 2014-08-18 13:38:36 | [diff] [blame] | 313 | test_hooks_->BeginMainFrame(args); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 314 | } |
| 315 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 316 | void Layout() override { test_hooks_->Layout(); } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 317 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 318 | void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, |
| 319 | const gfx::Vector2d& outer_delta, |
ccameron | 98be9ac | 2014-12-09 19:56:32 | [diff] [blame] | 320 | const gfx::Vector2dF& elastic_overscroll_delta, |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 321 | float page_scale, |
| 322 | float top_controls_delta) override { |
ccameron | 98be9ac | 2014-12-09 19:56:32 | [diff] [blame] | 323 | test_hooks_->ApplyViewportDeltas(inner_delta, outer_delta, |
| 324 | elastic_overscroll_delta, page_scale, |
bokan | 59379b09 | 2014-09-29 13:47:21 | [diff] [blame] | 325 | top_controls_delta); |
| 326 | } |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 327 | void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, |
| 328 | float scale, |
| 329 | float top_controls_delta) override { |
bokan | 88eae01 | 2014-09-09 20:40:42 | [diff] [blame] | 330 | test_hooks_->ApplyViewportDeltas(scroll_delta, |
| 331 | scale, |
| 332 | top_controls_delta); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 333 | } |
| 334 | |
enne | 7f8fdde | 2014-12-10 21:32:09 | [diff] [blame] | 335 | void RequestNewOutputSurface() override { |
| 336 | test_hooks_->RequestNewOutputSurface(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 337 | } |
| 338 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 339 | void DidInitializeOutputSurface() override { |
danakj@chromium.org | da8e3b72b | 2014-04-25 02:33:45 | [diff] [blame] | 340 | test_hooks_->DidInitializeOutputSurface(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 341 | } |
| 342 | |
simonhong | d3d5f7f | 2014-11-21 16:38:03 | [diff] [blame] | 343 | void SendBeginFramesToChildren(const BeginFrameArgs& args) override { |
| 344 | test_hooks_->SendBeginFramesToChildren(args); |
| 345 | } |
| 346 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 347 | void DidFailToInitializeOutputSurface() override { |
boliu@chromium.org | 04049fc | 2013-05-01 03:13:20 | [diff] [blame] | 348 | test_hooks_->DidFailToInitializeOutputSurface(); |
enne | 7f8fdde | 2014-12-10 21:32:09 | [diff] [blame] | 349 | RequestNewOutputSurface(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 350 | } |
| 351 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 352 | void WillCommit() override { test_hooks_->WillCommit(); } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 353 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 354 | void DidCommit() override { test_hooks_->DidCommit(); } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 355 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 356 | void DidCommitAndDrawFrame() override { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 357 | test_hooks_->DidCommitAndDrawFrame(); |
| 358 | } |
| 359 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 360 | void DidCompleteSwapBuffers() override { |
piman@chromium.org | 2ae13edf | 2013-05-08 16:02:38 | [diff] [blame] | 361 | test_hooks_->DidCompleteSwapBuffers(); |
| 362 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 363 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 364 | void DidPostSwapBuffers() override {} |
| 365 | void DidAbortSwapBuffers() override {} |
jbauman | 399aec1a | 2014-10-25 02:33:32 | [diff] [blame] | 366 | void ScheduleComposite() override { test_hooks_->ScheduleComposite(); } |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 367 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 368 | private: |
| 369 | explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) |
| 370 | : test_hooks_(test_hooks) {} |
| 371 | |
| 372 | TestHooks* test_hooks_; |
| 373 | }; |
| 374 | |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 375 | // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. |
| 376 | class LayerTreeHostForTesting : public LayerTreeHost { |
| 377 | public: |
| 378 | static scoped_ptr<LayerTreeHostForTesting> Create( |
| 379 | TestHooks* test_hooks, |
| 380 | LayerTreeHostClientForTesting* client, |
| 381 | const LayerTreeSettings& settings, |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 382 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 383 | scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 384 | scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 385 | scoped_ptr<LayerTreeHostForTesting> layer_tree_host( |
| 386 | new LayerTreeHostForTesting(test_hooks, client, settings)); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 387 | if (impl_task_runner.get()) { |
| 388 | layer_tree_host->InitializeForTesting( |
| 389 | ThreadProxyForTest::Create(test_hooks, |
| 390 | layer_tree_host.get(), |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 391 | main_task_runner, |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 392 | impl_task_runner, |
| 393 | external_begin_frame_source.Pass())); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 394 | } else { |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 395 | layer_tree_host->InitializeForTesting(SingleThreadProxy::Create( |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 396 | layer_tree_host.get(), |
| 397 | client, |
| 398 | main_task_runner, |
| 399 | external_begin_frame_source.Pass())); |
simonhong@chromium.org | 6f0fdcb | 2014-05-22 02:51:56 | [diff] [blame] | 400 | } |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 401 | return layer_tree_host.Pass(); |
| 402 | } |
| 403 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 404 | scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 405 | LayerTreeHostImplClient* host_impl_client) override { |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 406 | return LayerTreeHostImplForTesting::Create( |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 407 | test_hooks_, |
| 408 | settings(), |
| 409 | host_impl_client, |
| 410 | proxy(), |
| 411 | shared_bitmap_manager_.get(), |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 412 | gpu_memory_buffer_manager_.get(), |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 413 | rendering_stats_instrumentation()); |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 414 | } |
| 415 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 416 | void SetNeedsCommit() override { |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 417 | if (!test_started_) |
| 418 | return; |
| 419 | LayerTreeHost::SetNeedsCommit(); |
| 420 | } |
| 421 | |
| 422 | void set_test_started(bool started) { test_started_ = started; } |
| 423 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 424 | void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 425 | |
| 426 | private: |
| 427 | LayerTreeHostForTesting(TestHooks* test_hooks, |
| 428 | LayerTreeHostClient* client, |
| 429 | const LayerTreeSettings& settings) |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 430 | : LayerTreeHost(client, NULL, NULL, settings), |
| 431 | shared_bitmap_manager_(new TestSharedBitmapManager), |
| 432 | gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager), |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 433 | test_hooks_(test_hooks), |
| 434 | test_started_(false) {} |
| 435 | |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 436 | scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_; |
| 437 | scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
jamesr@chromium.org | 943528e | 2013-11-07 05:01:32 | [diff] [blame] | 438 | TestHooks* test_hooks_; |
| 439 | bool test_started_; |
| 440 | }; |
| 441 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 442 | LayerTreeTest::LayerTreeTest() |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 443 | : output_surface_(nullptr), |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 444 | external_begin_frame_source_(nullptr), |
enne | 03dbe8ae | 2014-10-30 01:32:55 | [diff] [blame] | 445 | beginning_(false), |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 446 | end_when_begin_returns_(false), |
| 447 | timed_out_(false), |
| 448 | scheduled_(false), |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 449 | started_(false), |
| 450 | ended_(false), |
danakj@chromium.org | 2a61ad5 | 2013-05-13 14:01:29 | [diff] [blame] | 451 | delegating_renderer_(false), |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 452 | timeout_seconds_(0), |
scherkus@chromium.org | 257b1a07 | 2013-04-26 08:01:40 | [diff] [blame] | 453 | weak_factory_(this) { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 454 | main_thread_weak_ptr_ = weak_factory_.GetWeakPtr(); |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 455 | |
| 456 | // Tests should timeout quickly unless --cc-layer-tree-test-no-timeout was |
| 457 | // specified (for running in a debugger). |
pgal.u-szeged | 8c86796 | 2014-11-18 16:24:44 | [diff] [blame] | 458 | base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
vollick@chromium.org | 8309341c | 2013-04-29 21:11:31 | [diff] [blame] | 459 | if (!command_line->HasSwitch(switches::kCCLayerTreeTestNoTimeout)) |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 460 | timeout_seconds_ = 5; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | LayerTreeTest::~LayerTreeTest() {} |
| 464 | |
| 465 | void LayerTreeTest::EndTest() { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 466 | if (ended_) |
| 467 | return; |
enne@chromium.org | 66bfba6 | 2013-07-13 00:27:01 | [diff] [blame] | 468 | ended_ = true; |
| 469 | |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 470 | // For the case where we EndTest during BeginTest(), set a flag to indicate |
| 471 | // that the test should end the second BeginTest regains control. |
leandrogracia@chromium.org | 7539d51 | 2013-03-22 15:56:44 | [diff] [blame] | 472 | if (beginning_) { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 473 | end_when_begin_returns_ = true; |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 474 | } else { |
| 475 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 476 | FROM_HERE, |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 477 | base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
leandrogracia@chromium.org | 7539d51 | 2013-03-22 15:56:44 | [diff] [blame] | 478 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 479 | } |
| 480 | |
danakj | a819c255 | 2014-11-14 02:05:04 | [diff] [blame] | 481 | void LayerTreeTest::EndTestAfterDelayMs(int delay_milliseconds) { |
caseq@chromium.org | 2c6998c | 2014-04-03 11:33:57 | [diff] [blame] | 482 | main_task_runner_->PostDelayedTask( |
| 483 | FROM_HERE, |
| 484 | base::Bind(&LayerTreeTest::EndTest, main_thread_weak_ptr_), |
| 485 | base::TimeDelta::FromMilliseconds(delay_milliseconds)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | void LayerTreeTest::PostAddAnimationToMainThread( |
| 489 | Layer* layer_to_receive_animation) { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 490 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 491 | FROM_HERE, |
behara.ms | 591d77f9 | 2014-11-18 16:01:40 | [diff] [blame] | 492 | base::Bind(&LayerTreeTest::DispatchAddAnimation, main_thread_weak_ptr_, |
| 493 | base::Unretained(layer_to_receive_animation), 0.000004)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 494 | } |
| 495 | |
danakj@chromium.org | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 496 | void LayerTreeTest::PostAddInstantAnimationToMainThread( |
| 497 | Layer* layer_to_receive_animation) { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 498 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 499 | FROM_HERE, |
ajuma@chromium.org | 40880faa | 2013-11-18 08:10:00 | [diff] [blame] | 500 | base::Bind(&LayerTreeTest::DispatchAddAnimation, |
danakj@chromium.org | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 501 | main_thread_weak_ptr_, |
ajuma@chromium.org | 40880faa | 2013-11-18 08:10:00 | [diff] [blame] | 502 | base::Unretained(layer_to_receive_animation), |
| 503 | 0.0)); |
| 504 | } |
| 505 | |
| 506 | void LayerTreeTest::PostAddLongAnimationToMainThread( |
| 507 | Layer* layer_to_receive_animation) { |
| 508 | main_task_runner_->PostTask( |
| 509 | FROM_HERE, |
| 510 | base::Bind(&LayerTreeTest::DispatchAddAnimation, |
| 511 | main_thread_weak_ptr_, |
| 512 | base::Unretained(layer_to_receive_animation), |
| 513 | 1.0)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | void LayerTreeTest::PostSetNeedsCommitToMainThread() { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 517 | main_task_runner_->PostTask(FROM_HERE, |
| 518 | base::Bind(&LayerTreeTest::DispatchSetNeedsCommit, |
| 519 | main_thread_weak_ptr_)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 520 | } |
| 521 | |
miletus@chromium.org | b69c1db | 2013-11-27 00:05:19 | [diff] [blame] | 522 | void LayerTreeTest::PostSetNeedsUpdateLayersToMainThread() { |
| 523 | main_task_runner_->PostTask( |
| 524 | FROM_HERE, |
| 525 | base::Bind(&LayerTreeTest::DispatchSetNeedsUpdateLayers, |
| 526 | main_thread_weak_ptr_)); |
| 527 | } |
| 528 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 529 | void LayerTreeTest::PostSetNeedsRedrawToMainThread() { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 530 | main_task_runner_->PostTask(FROM_HERE, |
| 531 | base::Bind(&LayerTreeTest::DispatchSetNeedsRedraw, |
| 532 | main_thread_weak_ptr_)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 533 | } |
| 534 | |
prashant.n@samsung.com | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 535 | void LayerTreeTest::PostSetNeedsRedrawRectToMainThread( |
| 536 | const gfx::Rect& damage_rect) { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 537 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 538 | FROM_HERE, |
skaslev@chromium.org | 878705be | 2013-04-15 22:44:02 | [diff] [blame] | 539 | base::Bind(&LayerTreeTest::DispatchSetNeedsRedrawRect, |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 540 | main_thread_weak_ptr_, |
| 541 | damage_rect)); |
skaslev@chromium.org | 878705be | 2013-04-15 22:44:02 | [diff] [blame] | 542 | } |
| 543 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 544 | void LayerTreeTest::PostSetVisibleToMainThread(bool visible) { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 545 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 546 | FROM_HERE, |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 547 | base::Bind( |
| 548 | &LayerTreeTest::DispatchSetVisible, main_thread_weak_ptr_, visible)); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 549 | } |
| 550 | |
kbr@chromium.org | 7d08a935 | 2013-10-15 08:24:56 | [diff] [blame] | 551 | void LayerTreeTest::PostSetNextCommitForcesRedrawToMainThread() { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 552 | main_task_runner_->PostTask( |
kbr@chromium.org | 7d08a935 | 2013-10-15 08:24:56 | [diff] [blame] | 553 | FROM_HERE, |
| 554 | base::Bind(&LayerTreeTest::DispatchSetNextCommitForcesRedraw, |
| 555 | main_thread_weak_ptr_)); |
| 556 | } |
| 557 | |
enne | 69277cb | 2014-10-29 23:03:40 | [diff] [blame] | 558 | void LayerTreeTest::PostCompositeImmediatelyToMainThread() { |
| 559 | main_task_runner_->PostTask( |
| 560 | FROM_HERE, |
| 561 | base::Bind(&LayerTreeTest::DispatchCompositeImmediately, |
| 562 | main_thread_weak_ptr_)); |
| 563 | } |
| 564 | |
sievers@google.com | e96e343 | 2013-12-19 18:56:07 | [diff] [blame] | 565 | void LayerTreeTest::WillBeginTest() { |
| 566 | layer_tree_host_->SetLayerTreeHostClientReady(); |
| 567 | } |
| 568 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 569 | void LayerTreeTest::DoBeginTest() { |
| 570 | client_ = LayerTreeHostClientForTesting::Create(this); |
| 571 | |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 572 | scoped_ptr<FakeExternalBeginFrameSource> external_begin_frame_source; |
simonhong | 2880b8e | 2014-11-11 23:25:36 | [diff] [blame] | 573 | if (settings_.use_external_begin_frame_source && |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 574 | settings_.throttle_frame_production) { |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 575 | external_begin_frame_source.reset(new FakeExternalBeginFrameSource( |
jbauman | c5be44c | 2014-11-20 22:17:12 | [diff] [blame] | 576 | settings_.renderer_settings.refresh_rate)); |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 577 | external_begin_frame_source_ = external_begin_frame_source.get(); |
| 578 | } |
| 579 | |
rsleevi@chromium.org | 198b590 | 2013-06-27 10:36:11 | [diff] [blame] | 580 | DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 581 | layer_tree_host_ = LayerTreeHostForTesting::Create( |
| 582 | this, |
| 583 | client_.get(), |
| 584 | settings_, |
skyostil@chromium.org | 27e6a21 | 2014-07-18 15:51:27 | [diff] [blame] | 585 | base::MessageLoopProxy::current(), |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 586 | impl_thread_ ? impl_thread_->message_loop_proxy() : NULL, |
| 587 | external_begin_frame_source.Pass()); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 588 | ASSERT_TRUE(layer_tree_host_); |
| 589 | |
| 590 | started_ = true; |
| 591 | beginning_ = true; |
| 592 | SetupTree(); |
sievers@google.com | e96e343 | 2013-12-19 18:56:07 | [diff] [blame] | 593 | WillBeginTest(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 594 | BeginTest(); |
| 595 | beginning_ = false; |
| 596 | if (end_when_begin_returns_) |
| 597 | RealEndTest(); |
| 598 | |
| 599 | // Allow commits to happen once BeginTest() has had a chance to post tasks |
| 600 | // so that those tasks will happen before the first commit. |
| 601 | if (layer_tree_host_) { |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 602 | static_cast<LayerTreeHostForTesting*>(layer_tree_host_.get()) |
| 603 | ->set_test_started(true); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 604 | } |
| 605 | } |
| 606 | |
| 607 | void LayerTreeTest::SetupTree() { |
| 608 | if (!layer_tree_host_->root_layer()) { |
| 609 | scoped_refptr<Layer> root_layer = Layer::Create(); |
| 610 | root_layer->SetBounds(gfx::Size(1, 1)); |
danakj@chromium.org | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 611 | root_layer->SetIsDrawable(true); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 612 | layer_tree_host_->SetRootLayer(root_layer); |
| 613 | } |
| 614 | |
| 615 | gfx::Size root_bounds = layer_tree_host_->root_layer()->bounds(); |
| 616 | gfx::Size device_root_bounds = gfx::ToCeiledSize( |
| 617 | gfx::ScaleSize(root_bounds, layer_tree_host_->device_scale_factor())); |
aelias@chromium.org | 18ce5970 | 2013-04-09 04:58:40 | [diff] [blame] | 618 | layer_tree_host_->SetViewportSize(device_root_bounds); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | void LayerTreeTest::Timeout() { |
| 622 | timed_out_ = true; |
| 623 | EndTest(); |
| 624 | } |
| 625 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 626 | void LayerTreeTest::RealEndTest() { |
danakj@chromium.org | 4ea293f7 | 2014-08-13 03:03:17 | [diff] [blame] | 627 | if (layer_tree_host_ && !timed_out_ && |
| 628 | proxy()->MainFrameWillHappenForTesting()) { |
danakj@chromium.org | 7ac8dcb | 2013-10-31 09:58:38 | [diff] [blame] | 629 | main_task_runner_->PostTask( |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 630 | FROM_HERE, |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 631 | base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
| 632 | return; |
| 633 | } |
jamesr@chromium.org | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 634 | |
xhwang@chromium.org | 2811f31 | 2013-04-27 05:21:17 | [diff] [blame] | 635 | base::MessageLoop::current()->Quit(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 636 | } |
| 637 | |
ajuma@chromium.org | 40880faa | 2013-11-18 08:10:00 | [diff] [blame] | 638 | void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 639 | double animation_duration) { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 640 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 641 | |
danakj@chromium.org | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 642 | if (layer_to_receive_animation) { |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 643 | AddOpacityTransitionToLayer( |
| 644 | layer_to_receive_animation, animation_duration, 0, 0.5, true); |
danakj@chromium.org | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 645 | } |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | void LayerTreeTest::DispatchSetNeedsCommit() { |
| 649 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 650 | |
| 651 | if (layer_tree_host_) |
| 652 | layer_tree_host_->SetNeedsCommit(); |
| 653 | } |
| 654 | |
miletus@chromium.org | b69c1db | 2013-11-27 00:05:19 | [diff] [blame] | 655 | void LayerTreeTest::DispatchSetNeedsUpdateLayers() { |
| 656 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 657 | |
| 658 | if (layer_tree_host_) |
| 659 | layer_tree_host_->SetNeedsUpdateLayers(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 660 | } |
| 661 | |
| 662 | void LayerTreeTest::DispatchSetNeedsRedraw() { |
| 663 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 664 | |
| 665 | if (layer_tree_host_) |
| 666 | layer_tree_host_->SetNeedsRedraw(); |
| 667 | } |
| 668 | |
prashant.n@samsung.com | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 669 | void LayerTreeTest::DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect) { |
skaslev@chromium.org | 878705be | 2013-04-15 22:44:02 | [diff] [blame] | 670 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 671 | |
| 672 | if (layer_tree_host_) |
| 673 | layer_tree_host_->SetNeedsRedrawRect(damage_rect); |
| 674 | } |
| 675 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 676 | void LayerTreeTest::DispatchSetVisible(bool visible) { |
| 677 | DCHECK(!proxy() || proxy()->IsMainThread()); |
enne@chromium.org | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 678 | if (layer_tree_host_) |
| 679 | layer_tree_host_->SetVisible(visible); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 680 | } |
| 681 | |
kbr@chromium.org | 7d08a935 | 2013-10-15 08:24:56 | [diff] [blame] | 682 | void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { |
| 683 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 684 | |
| 685 | if (layer_tree_host_) |
mark@chromium.org | 8b9e52b | 2014-01-17 16:35:31 | [diff] [blame] | 686 | layer_tree_host_->SetNextCommitForcesRedraw(); |
enne@chromium.org | 2decdd78 | 2014-08-13 22:36:06 | [diff] [blame] | 687 | } |
| 688 | |
enne | 69277cb | 2014-10-29 23:03:40 | [diff] [blame] | 689 | void LayerTreeTest::DispatchCompositeImmediately() { |
| 690 | DCHECK(!proxy() || proxy()->IsMainThread()); |
| 691 | if (layer_tree_host_) |
| 692 | layer_tree_host_->Composite(gfx::FrameTime::Now()); |
| 693 | } |
| 694 | |
danakj@chromium.org | 2a61ad5 | 2013-05-13 14:01:29 | [diff] [blame] | 695 | void LayerTreeTest::RunTest(bool threaded, |
| 696 | bool delegating_renderer, |
| 697 | bool impl_side_painting) { |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 698 | if (threaded) { |
vollick@chromium.org | 8309341c | 2013-04-29 21:11:31 | [diff] [blame] | 699 | impl_thread_.reset(new base::Thread("Compositor")); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 700 | ASSERT_TRUE(impl_thread_->Start()); |
| 701 | } |
| 702 | |
danakj@chromium.org | bcc5c38 | 2013-09-19 22:42:17 | [diff] [blame] | 703 | main_task_runner_ = base::MessageLoopProxy::current(); |
danakj@chromium.org | 4145d17 | 2013-05-10 16:54:36 | [diff] [blame] | 704 | |
| 705 | delegating_renderer_ = delegating_renderer; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 706 | |
brianderson@chromium.org | 97e9ccd6 | 2014-04-12 01:07:15 | [diff] [blame] | 707 | // Spend less time waiting for BeginFrame because the output is |
brianderson@chromium.org | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame] | 708 | // mocked out. |
jbauman | c5be44c | 2014-11-20 22:17:12 | [diff] [blame] | 709 | settings_.renderer_settings.refresh_rate = 200.0; |
mithro | 719bf679 | 2014-11-10 15:36:47 | [diff] [blame] | 710 | settings_.background_animation_rate = 200.0; |
enne | 98f3a6c | 2014-10-09 20:09:44 | [diff] [blame] | 711 | settings_.impl_side_painting = impl_side_painting; |
vollick | 51ed1a2 | 2014-12-17 02:03:00 | [diff] [blame^] | 712 | settings_.verify_property_trees = true; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 713 | InitializeSettings(&settings_); |
| 714 | |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 715 | main_task_runner_->PostTask( |
| 716 | FROM_HERE, |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 717 | base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 718 | |
| 719 | if (timeout_seconds_) { |
| 720 | timeout_.Reset(base::Bind(&LayerTreeTest::Timeout, base::Unretained(this))); |
danakj@chromium.org | 810d40b7 | 2013-06-20 18:26:15 | [diff] [blame] | 721 | main_task_runner_->PostDelayedTask( |
| 722 | FROM_HERE, |
danakj@chromium.org | 4fc1b79 | 2013-03-26 08:58:57 | [diff] [blame] | 723 | timeout_.callback(), |
| 724 | base::TimeDelta::FromSeconds(timeout_seconds_)); |
| 725 | } |
| 726 | |
xhwang@chromium.org | 2811f31 | 2013-04-27 05:21:17 | [diff] [blame] | 727 | base::MessageLoop::current()->Run(); |
danakj@chromium.org | df17af5 | 2014-02-06 02:20:40 | [diff] [blame] | 728 | DestroyLayerTreeHost(); |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 729 | |
| 730 | timeout_.Cancel(); |
| 731 | |
| 732 | ASSERT_FALSE(layer_tree_host_.get()); |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 733 | client_ = nullptr; |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 734 | if (timed_out_) { |
| 735 | FAIL() << "Test timed out"; |
| 736 | return; |
| 737 | } |
| 738 | AfterTest(); |
| 739 | } |
| 740 | |
clholgat@chromium.org | c0f7a7f | 2013-10-15 21:33:56 | [diff] [blame] | 741 | void LayerTreeTest::RunTestWithImplSidePainting() { |
| 742 | RunTest(true, false, true); |
| 743 | } |
| 744 | |
enne | 7f8fdde | 2014-12-10 21:32:09 | [diff] [blame] | 745 | void LayerTreeTest::RequestNewOutputSurface() { |
| 746 | layer_tree_host_->SetOutputSurface(CreateOutputSurface()); |
enne | 2097cab | 2014-09-25 20:16:31 | [diff] [blame] | 747 | } |
| 748 | |
enne | 7f8fdde | 2014-12-10 21:32:09 | [diff] [blame] | 749 | scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface() { |
| 750 | scoped_ptr<FakeOutputSurface> output_surface = CreateFakeOutputSurface(); |
| 751 | DCHECK_EQ(delegating_renderer_, |
| 752 | output_surface->capabilities().delegated_rendering); |
brianderson@chromium.org | 049fc7a | 2013-06-18 12:32:35 | [diff] [blame] | 753 | output_surface_ = output_surface.get(); |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 754 | |
simonhong | 2880b8e | 2014-11-11 23:25:36 | [diff] [blame] | 755 | if (settings_.use_external_begin_frame_source && |
simonhong | a7e3ac4 | 2014-11-11 20:50:22 | [diff] [blame] | 756 | settings_.throttle_frame_production) { |
| 757 | DCHECK(external_begin_frame_source_); |
| 758 | DCHECK(external_begin_frame_source_->is_ready()); |
| 759 | } |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 760 | return output_surface.Pass(); |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 761 | } |
| 762 | |
enne | 7f8fdde | 2014-12-10 21:32:09 | [diff] [blame] | 763 | scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface() { |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 764 | if (delegating_renderer_) |
| 765 | return FakeOutputSurface::CreateDelegating3d(); |
| 766 | else |
| 767 | return FakeOutputSurface::Create3d(); |
danakj@chromium.org | 4145d17 | 2013-05-10 16:54:36 | [diff] [blame] | 768 | } |
| 769 | |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 770 | TestWebGraphicsContext3D* LayerTreeTest::TestContext() { |
dcheng | 6afa1700 | 2014-08-26 19:11:31 | [diff] [blame] | 771 | return static_cast<TestContextProvider*>(output_surface_->context_provider()) |
| 772 | ->TestContext3d(); |
jamesr@chromium.org | e7e7ebd | 2014-01-16 00:11:11 | [diff] [blame] | 773 | } |
| 774 | |
enne@chromium.org | 98ea818e | 2014-01-24 10:22:08 | [diff] [blame] | 775 | int LayerTreeTest::LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) |
| 776 | const { |
| 777 | if (impl->pending_tree()) |
| 778 | return impl->pending_tree()->source_frame_number(); |
| 779 | if (impl->active_tree()) |
| 780 | return impl->active_tree()->source_frame_number(); |
| 781 | // Source frames start at 0, so this is invalid. |
| 782 | return -1; |
| 783 | } |
| 784 | |
danakj@chromium.org | df17af5 | 2014-02-06 02:20:40 | [diff] [blame] | 785 | void LayerTreeTest::DestroyLayerTreeHost() { |
| 786 | if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 787 | layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
danakj | f446a07 | 2014-09-27 21:55:48 | [diff] [blame] | 788 | layer_tree_host_ = nullptr; |
danakj@chromium.org | df17af5 | 2014-02-06 02:20:40 | [diff] [blame] | 789 | } |
| 790 | |
danakj@chromium.org | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 791 | } // namespace cc |