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

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

Issue 1033563002: cc: Various code safety improvements in video compositing code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/render_surface_impl.h" 8 #include "cc/layers/render_surface_impl.h"
9 #include "cc/layers/video_layer.h" 9 #include "cc/layers/video_layer.h"
10 #include "cc/layers/video_layer_impl.h" 10 #include "cc/layers/video_layer_impl.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return draw_result; 70 return draw_result;
71 } 71 }
72 72
73 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { 73 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
74 VideoLayerImpl* video = static_cast<VideoLayerImpl*>( 74 VideoLayerImpl* video = static_cast<VideoLayerImpl*>(
75 host_impl->active_tree()->root_layer()->children()[0]); 75 host_impl->active_tree()->root_layer()->children()[0]);
76 76
77 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation()); 77 EXPECT_EQ(media::VIDEO_ROTATION_90, video->video_rotation());
78 78
79 if (num_draws_ == 0) 79 if (num_draws_ == 0)
80 video->SetNeedsRedraw(); 80 video_frame_provider_.SendDidReceiveFrame();
81 81
82 ++num_draws_; 82 ++num_draws_;
83 } 83 }
84 84
85 void AfterTest() override { EXPECT_EQ(2, num_draws_); } 85 void AfterTest() override { EXPECT_EQ(2, num_draws_); }
86 86
87 private: 87 private:
88 int num_draws_; 88 int num_draws_;
89 89
90 FakeVideoFrameProvider video_frame_provider_; 90 FakeVideoFrameProvider video_frame_provider_;
91 }; 91 };
92 92
93 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay); 93 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostVideoTestSetNeedsDisplay);
94 94
95 } // namespace 95 } // namespace
96 } // namespace cc 96 } // namespace cc
OLDNEW
« cc/test/fake_video_frame_provider.h ('K') | « cc/test/fake_video_frame_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698