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

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

Issue 2108033004: cc: Re-enable GPU rasterization after content veto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update 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
« no previous file with comments | « no previous file | cc/test/fake_recording_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 1, RecordingSource::RECORD_NORMALLY);
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->SetForceUnsuitableForGpuRasterization(true);
452 EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization()); 452 EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization());
453 EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); 453 EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
454 } 454 }
455 455
456 // PicturePile uses the source frame number as a unit for measuring invalidation 456 // PicturePile uses the source frame number as a unit for measuring invalidation
457 // frequency. When a pile moves between compositors, the frame number increases 457 // frequency. When a pile moves between compositors, the frame number increases
458 // non-monotonically. This executes that code path under this scenario allowing 458 // non-monotonically. This executes that code path under this scenario allowing
459 // for the code to verify correctness with DCHECKs. 459 // for the code to verify correctness with DCHECKs.
460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { 460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) {
461 LayerTreeSettings settings; 461 LayerTreeSettings settings;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // Do a main frame, record the picture layers. The frame number has changed 520 // Do a main frame, record the picture layers. The frame number has changed
521 // non-monotonically. 521 // non-monotonically.
522 layer->SetNeedsDisplay(); 522 layer->SetNeedsDisplay();
523 host2->Composite(base::TimeTicks::Now()); 523 host2->Composite(base::TimeTicks::Now());
524 EXPECT_EQ(3, layer->update_count()); 524 EXPECT_EQ(3, layer->update_count());
525 EXPECT_EQ(1, host2->source_frame_number()); 525 EXPECT_EQ(1, host2->source_frame_number());
526 } 526 }
527 527
528 } // namespace 528 } // namespace
529 } // namespace cc 529 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_recording_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698