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

Side by Side Diff: components/mus/public/cpp/surfaces/surfaces_utils.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
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 "components/mus/public/cpp/surfaces/surfaces_utils.h" 5 #include "components/mus/public/cpp/surfaces/surfaces_utils.h"
6 6
7 #include "ui/gfx/geometry/rect.h" 7 #include "ui/gfx/geometry/rect.h"
8 #include "ui/gfx/geometry/size.h" 8 #include "ui/gfx/geometry/size.h"
9 #include "ui/gfx/transform.h" 9 #include "ui/gfx/transform.h"
10 10
11 using cc::mojom::RenderPass; 11 using cc::mojom::RenderPass;
12 using cc::mojom::RenderPassPtr; 12 using cc::mojom::RenderPassPtr;
13 13
14 namespace mojo { 14 namespace mojo {
15 15
16 cc::SharedQuadState CreateDefaultSQS(const gfx::Size& size) { 16 void ConfigureSharedQuadState(const gfx::Size& size, cc::SharedQuadState* out) {
17 cc::SharedQuadState sqs; 17 out->quad_layer_bounds = size;
18 sqs.quad_layer_bounds = size; 18 out->visible_quad_layer_rect = gfx::Rect(size);
19 sqs.visible_quad_layer_rect = gfx::Rect(size); 19 out->clip_rect = gfx::Rect(size);
20 sqs.clip_rect = gfx::Rect(size); 20 out->is_clipped = false;
21 sqs.is_clipped = false; 21 out->opacity = 1.f;
22 sqs.opacity = 1.f; 22 out->blend_mode = SkXfermode::kSrc_Mode;
23 sqs.blend_mode = SkXfermode::kSrc_Mode; 23 out->sorting_context_id = 0;
24 sqs.sorting_context_id = 0;
25 return sqs;
26 } 24 }
27 25
28 RenderPassPtr CreateDefaultPass(int id, const gfx::Rect& rect) { 26 RenderPassPtr CreateDefaultPass(int id, const gfx::Rect& rect) {
29 RenderPassPtr pass = RenderPass::New(); 27 RenderPassPtr pass = RenderPass::New();
30 cc::RenderPassId render_pass_id; 28 cc::RenderPassId render_pass_id;
31 render_pass_id.layer_id = 1; 29 render_pass_id.layer_id = 1;
32 render_pass_id.index = id; 30 render_pass_id.index = id;
33 pass->id = render_pass_id; 31 pass->id = render_pass_id;
34 pass->output_rect = rect; 32 pass->output_rect = rect;
35 pass->damage_rect = rect; 33 pass->damage_rect = rect;
36 pass->has_transparent_background = false; 34 pass->has_transparent_background = false;
37 return pass; 35 return pass;
38 } 36 }
39 37
40 } // namespace mojo 38 } // namespace mojo
OLDNEW
« no previous file with comments | « components/mus/public/cpp/surfaces/surfaces_utils.h ('k') | components/mus/public/cpp/surfaces/tests/surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698