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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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/layers/video_layer_impl.cc ('k') | cc/layers/viewport.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/video_frame_provider_client_impl.h" 9 #include "cc/layers/video_frame_provider_client_impl.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 TEST(VideoLayerImplTest, OccludesOtherLayers) { 87 TEST(VideoLayerImplTest, OccludesOtherLayers) {
88 gfx::Size layer_size(1000, 1000); 88 gfx::Size layer_size(1000, 1000);
89 gfx::Rect visible(layer_size); 89 gfx::Rect visible(layer_size);
90 90
91 LayerTestCommon::LayerImplTest impl; 91 LayerTestCommon::LayerImplTest impl;
92 impl.host_impl()->SetViewportSize(layer_size); 92 impl.host_impl()->SetViewportSize(layer_size);
93 DebugSetImplThreadAndMainThreadBlocked(impl.task_runner_provider()); 93 DebugSetImplThreadAndMainThreadBlocked(impl.task_runner_provider());
94 auto active_tree = impl.host_impl()->active_tree(); 94 auto active_tree = impl.host_impl()->active_tree();
95 95
96 // Create a video layer with no frame on top of another layer. 96 // Create a video layer with no frame on top of another layer.
97 scoped_ptr<LayerImpl> layer_impl = LayerImpl::Create(active_tree, 3); 97 std::unique_ptr<LayerImpl> layer_impl = LayerImpl::Create(active_tree, 3);
98 layer_impl->SetForceRenderSurface(true); 98 layer_impl->SetForceRenderSurface(true);
99 layer_impl->SetBounds(layer_size); 99 layer_impl->SetBounds(layer_size);
100 layer_impl->SetDrawsContent(true); 100 layer_impl->SetDrawsContent(true);
101 const auto& draw_properties = layer_impl->draw_properties(); 101 const auto& draw_properties = layer_impl->draw_properties();
102 102
103 FakeVideoFrameProvider provider; 103 FakeVideoFrameProvider provider;
104 scoped_ptr<VideoLayerImpl> video_layer_impl = VideoLayerImpl::Create( 104 std::unique_ptr<VideoLayerImpl> video_layer_impl = VideoLayerImpl::Create(
105 active_tree, 4, &provider, media::VIDEO_ROTATION_0); 105 active_tree, 4, &provider, media::VIDEO_ROTATION_0);
106 video_layer_impl->SetBounds(layer_size); 106 video_layer_impl->SetBounds(layer_size);
107 video_layer_impl->SetDrawsContent(true); 107 video_layer_impl->SetDrawsContent(true);
108 video_layer_impl->SetContentsOpaque(true); 108 video_layer_impl->SetContentsOpaque(true);
109 109
110 layer_impl->AddChild(std::move(video_layer_impl)); 110 layer_impl->AddChild(std::move(video_layer_impl));
111 active_tree->SetRootLayer(std::move(layer_impl)); 111 active_tree->SetRootLayer(std::move(layer_impl));
112 112
113 active_tree->BuildPropertyTreesForTesting(); 113 active_tree->BuildPropertyTreesForTesting();
114 114
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 const YUVVideoDrawQuad* yuv_draw_quad = 364 const YUVVideoDrawQuad* yuv_draw_quad =
365 static_cast<const YUVVideoDrawQuad*>(draw_quad); 365 static_cast<const YUVVideoDrawQuad*>(draw_quad);
366 EXPECT_EQ(yuv_draw_quad->uv_tex_size.height(), 366 EXPECT_EQ(yuv_draw_quad->uv_tex_size.height(),
367 (yuv_draw_quad->ya_tex_size.height() + 1) / 2); 367 (yuv_draw_quad->ya_tex_size.height() + 1) / 2);
368 EXPECT_EQ(yuv_draw_quad->uv_tex_size.width(), 368 EXPECT_EQ(yuv_draw_quad->uv_tex_size.width(),
369 (yuv_draw_quad->ya_tex_size.width() + 1) / 2); 369 (yuv_draw_quad->ya_tex_size.width() + 1) / 2);
370 } 370 }
371 371
372 } // namespace 372 } // namespace
373 } // namespace cc 373 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/layers/viewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698