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

Side by Side Diff: cc/trees/layer_tree_host_unittest_video.cc

Issue 2632463005: cc: Ensure that large damage doesn't register as "frame has no damage" (Closed)
Patch Set: update Created 3 years, 11 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 | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "cc/layers/render_surface_impl.h" 7 #include "cc/layers/render_surface_impl.h"
8 #include "cc/layers/video_layer.h" 8 #include "cc/layers/video_layer.h"
9 #include "cc/layers/video_layer_impl.h" 9 #include "cc/layers/video_layer_impl.h"
10 #include "cc/test/fake_video_frame_provider.h" 10 #include "cc/test/fake_video_frame_provider.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void BeginTest() override { 42 void BeginTest() override {
43 num_draws_ = 0; 43 num_draws_ = 0;
44 PostSetNeedsCommitToMainThread(); 44 PostSetNeedsCommitToMainThread();
45 } 45 }
46 46
47 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, 47 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
48 LayerTreeHostImpl::FrameData* frame, 48 LayerTreeHostImpl::FrameData* frame,
49 DrawResult draw_result) override { 49 DrawResult draw_result) override {
50 LayerImpl* root_layer = host_impl->active_tree()->root_layer_for_testing(); 50 LayerImpl* root_layer = host_impl->active_tree()->root_layer_for_testing();
51 RenderSurfaceImpl* root_surface = root_layer->render_surface(); 51 RenderSurfaceImpl* root_surface = root_layer->render_surface();
52 gfx::Rect damage_rect = 52 gfx::Rect damage_rect;
53 root_surface->damage_tracker()->current_damage_rect(); 53 EXPECT_TRUE(
54 root_surface->damage_tracker()->GetDamageRectIfValid(&damage_rect));
54 55
55 switch (num_draws_) { 56 switch (num_draws_) {
56 case 0: 57 case 0:
57 // First frame the whole viewport is damaged. 58 // First frame the whole viewport is damaged.
58 EXPECT_EQ(gfx::Rect(0, 0, 20, 20), damage_rect); 59 EXPECT_EQ(gfx::Rect(0, 0, 20, 20), damage_rect);
59 break; 60 break;
60 case 1: 61 case 1:
61 // Second frame the video layer is damaged. 62 // Second frame the video layer is damaged.
62 EXPECT_EQ(gfx::Rect(6, 6, 8, 10), damage_rect); 63 EXPECT_EQ(gfx::Rect(6, 6, 8, 10), damage_rect);
63 EndTest(); 64 EndTest();
(...skipping 22 matching lines...) Expand all
86 int num_draws_; 87 int num_draws_;
87 int video_layer_id_; 88 int video_layer_id_;
88 89
89 FakeVideoFrameProvider video_frame_provider_; 90 FakeVideoFrameProvider video_frame_provider_;
90 }; 91 };
91 92
92 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); 93 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay);
93 94
94 } // namespace 95 } // namespace
95 } // namespace cc 96 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698