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

Side by Side Diff: components/mus/public/cpp/surfaces/tests/surface_unittest.cc

Issue 2075853004: Implement SharedQuadStateList StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sky's comments Created 4 years, 6 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 | « components/mus/public/cpp/surfaces/surfaces_utils.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 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "cc/quads/debug_border_draw_quad.h" 10 #include "cc/quads/debug_border_draw_quad.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 TEST_F(SurfaceLibQuadTest, TextureQuadEmptyVertexOpacity) { 146 TEST_F(SurfaceLibQuadTest, TextureQuadEmptyVertexOpacity) {
147 DrawQuadPtr mus_texture_quad = DrawQuad::New(); 147 DrawQuadPtr mus_texture_quad = DrawQuad::New();
148 mus_texture_quad->material = cc::mojom::Material::TEXTURE_CONTENT; 148 mus_texture_quad->material = cc::mojom::Material::TEXTURE_CONTENT;
149 TextureQuadStatePtr mus_texture_state = TextureQuadState::New(); 149 TextureQuadStatePtr mus_texture_state = TextureQuadState::New();
150 mus_texture_quad->texture_quad_state = std::move(mus_texture_state); 150 mus_texture_quad->texture_quad_state = std::move(mus_texture_state);
151 RenderPassPtr mus_pass = RenderPass::New(); 151 RenderPassPtr mus_pass = RenderPass::New();
152 mus_pass->id.layer_id = 1; 152 mus_pass->id.layer_id = 1;
153 mus_pass->id.index = 1u; 153 mus_pass->id.index = 1u;
154 mus_pass->quads.push_back(std::move(mus_texture_quad)); 154 mus_pass->quads.push_back(std::move(mus_texture_quad));
155 mus_pass->shared_quad_states.push_back(cc::SharedQuadState()); 155 mus_pass->shared_quad_states.AllocateAndConstruct<cc::SharedQuadState>();
156 156
157 std::unique_ptr<cc::RenderPass> pass = 157 std::unique_ptr<cc::RenderPass> pass =
158 mus_pass.To<std::unique_ptr<cc::RenderPass>>(); 158 mus_pass.To<std::unique_ptr<cc::RenderPass>>();
159 159
160 EXPECT_FALSE(pass); 160 EXPECT_FALSE(pass);
161 } 161 }
162 162
163 TEST(SurfaceLibTest, RenderPass) { 163 TEST(SurfaceLibTest, RenderPass) {
164 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); 164 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create();
165 cc::RenderPassId pass_id(1, 6); 165 cc::RenderPassId pass_id(1, 6);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 EXPECT_EQ(needs_blending, mus_quad->needs_blending); 323 EXPECT_EQ(needs_blending, mus_quad->needs_blending);
324 ASSERT_TRUE(mus_quad->debug_border_quad_state); 324 ASSERT_TRUE(mus_quad->debug_border_quad_state);
325 DebugBorderQuadStatePtr& mus_debug_border_state = 325 DebugBorderQuadStatePtr& mus_debug_border_state =
326 mus_quad->debug_border_quad_state; 326 mus_quad->debug_border_quad_state;
327 EXPECT_EQ(arbitrary_color, mus_debug_border_state->color); 327 EXPECT_EQ(arbitrary_color, mus_debug_border_state->color);
328 EXPECT_EQ(width, mus_debug_border_state->width); 328 EXPECT_EQ(width, mus_debug_border_state->width);
329 } 329 }
330 330
331 } // namespace 331 } // namespace
332 } // namespace mojo 332 } // namespace mojo
OLDNEW
« no previous file with comments | « components/mus/public/cpp/surfaces/surfaces_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698