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

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

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove recoding_source_ from PictureLayer, and move all its internal state to PictureLayer Created 4 years, 5 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 TestTaskGraphRunner task_graph_runner; 434 TestTaskGraphRunner task_graph_runner;
435 std::unique_ptr<FakeLayerTreeHost> host = 435 std::unique_ptr<FakeLayerTreeHost> host =
436 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); 436 FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
437 host->SetRootLayer(layer); 437 host->SetRootLayer(layer);
438 438
439 // Update layers to initialize the recording source. 439 // Update layers to initialize the recording source.
440 gfx::Size layer_bounds(200, 200); 440 gfx::Size layer_bounds(200, 200);
441 gfx::Rect layer_rect(layer_bounds); 441 gfx::Rect layer_rect(layer_bounds);
442 Region invalidation(layer_rect); 442 Region invalidation(layer_rect);
443 recording_source->UpdateAndExpandInvalidation( 443 recording_source->UpdateAndExpandInvalidation(
444 client, &invalidation, layer_bounds, 1, RecordingSource::RECORD_NORMALLY); 444 client, &invalidation, layer_bounds, RecordingSource::RECORD_NORMALLY);
Menglin 2016/07/19 22:56:37 This is test code. don't need to look at change in
445 445
446 // Layer is suitable for gpu rasterization by default. 446 // Layer is suitable for gpu rasterization by default.
447 EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization()); 447 EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization());
448 EXPECT_TRUE(layer->IsSuitableForGpuRasterization()); 448 EXPECT_TRUE(layer->IsSuitableForGpuRasterization());
449 449
450 // Veto gpu rasterization. 450 // Veto gpu rasterization.
451 recording_source->SetUnsuitableForGpuRasterization(); 451 recording_source->SetUnsuitableForGpuRasterization();
452 EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization()); 452 EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
453 EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); 453 EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
454 } 454 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // Do a main frame, record the picture layers. The frame number has changed 521 // Do a main frame, record the picture layers. The frame number has changed
522 // non-monotonically. 522 // non-monotonically.
523 layer->SetNeedsDisplay(); 523 layer->SetNeedsDisplay();
524 host2->Composite(base::TimeTicks::Now()); 524 host2->Composite(base::TimeTicks::Now());
525 EXPECT_EQ(3, layer->update_count()); 525 EXPECT_EQ(3, layer->update_count());
526 EXPECT_EQ(1, host2->source_frame_number()); 526 EXPECT_EQ(1, host2->source_frame_number());
527 } 527 }
528 528
529 } // namespace 529 } // namespace
530 } // namespace cc 530 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698