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

Side by Side Diff: cc/layers/picture_layer_unittest.cc

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: update Created 3 years, 12 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client); 304 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client);
305 305
306 auto animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN); 306 auto animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
307 307
308 LayerTreeHostInProcess::InitParams params; 308 LayerTreeHostInProcess::InitParams params;
309 params.client = &host_client1; 309 params.client = &host_client1;
310 params.settings = &settings; 310 params.settings = &settings;
311 params.task_graph_runner = &task_graph_runner; 311 params.task_graph_runner = &task_graph_runner;
312 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); 312 params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
313 params.mutator_host = animation_host.get(); 313 params.mutator_host = animation_host.get();
314 params.image_worker_task_runner = nullptr;
314 std::unique_ptr<LayerTreeHost> host1 = 315 std::unique_ptr<LayerTreeHost> host1 =
315 LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client, 316 LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client,
316 &params); 317 &params);
317 host1->SetVisible(true); 318 host1->SetVisible(true);
318 host_client1.SetLayerTreeHost(host1.get()); 319 host_client1.SetLayerTreeHost(host1.get());
319 320
320 auto animation_host2 = AnimationHost::CreateForTesting(ThreadInstance::MAIN); 321 auto animation_host2 = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
321 322
322 // TODO(sad): InitParams will be movable. 323 // TODO(sad): InitParams will be movable.
323 LayerTreeHostInProcess::InitParams params2; 324 LayerTreeHostInProcess::InitParams params2;
324 params2.client = &host_client1; 325 params2.client = &host_client1;
325 params2.settings = &settings; 326 params2.settings = &settings;
326 params2.task_graph_runner = &task_graph_runner; 327 params2.task_graph_runner = &task_graph_runner;
327 params2.main_task_runner = base::ThreadTaskRunnerHandle::Get(); 328 params2.main_task_runner = base::ThreadTaskRunnerHandle::Get();
328 params2.client = &host_client2; 329 params2.client = &host_client2;
329 params2.mutator_host = animation_host2.get(); 330 params2.mutator_host = animation_host2.get();
331 params2.image_worker_task_runner = nullptr;
330 std::unique_ptr<LayerTreeHost> host2 = 332 std::unique_ptr<LayerTreeHost> host2 =
331 LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client, 333 LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client,
332 &params2); 334 &params2);
333 host2->SetVisible(true); 335 host2->SetVisible(true);
334 host_client2.SetLayerTreeHost(host2.get()); 336 host_client2.SetLayerTreeHost(host2.get());
335 337
336 // The PictureLayer is put in one LayerTreeHost. 338 // The PictureLayer is put in one LayerTreeHost.
337 host1->GetLayerTree()->SetRootLayer(layer); 339 host1->GetLayerTree()->SetRootLayer(layer);
338 // Do a main frame, record the picture layers. 340 // Do a main frame, record the picture layers.
339 EXPECT_EQ(0, layer->update_count()); 341 EXPECT_EQ(0, layer->update_count());
(...skipping 18 matching lines...) Expand all
358 host2->Composite(base::TimeTicks::Now()); 360 host2->Composite(base::TimeTicks::Now());
359 EXPECT_EQ(3, layer->update_count()); 361 EXPECT_EQ(3, layer->update_count());
360 EXPECT_EQ(1, host2->SourceFrameNumber()); 362 EXPECT_EQ(1, host2->SourceFrameNumber());
361 363
362 animation_host->SetMutatorHostClient(nullptr); 364 animation_host->SetMutatorHostClient(nullptr);
363 animation_host2->SetMutatorHostClient(nullptr); 365 animation_host2->SetMutatorHostClient(nullptr);
364 } 366 }
365 367
366 } // namespace 368 } // namespace
367 } // namespace cc 369 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698