OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/mus/public/cpp/surfaces/surfaces_utils.h" | |
6 | |
7 #include "ui/gfx/geometry/rect.h" | |
8 #include "ui/gfx/geometry/size.h" | |
9 #include "ui/gfx/transform.h" | |
10 | |
11 using cc::mojom::RenderPass; | |
12 using cc::mojom::RenderPassPtr; | |
13 | |
14 namespace mojo { | |
15 | |
16 void ConfigureSharedQuadState(const gfx::Size& size, cc::SharedQuadState* out) { | |
17 out->quad_layer_bounds = size; | |
18 out->visible_quad_layer_rect = gfx::Rect(size); | |
19 out->clip_rect = gfx::Rect(size); | |
20 out->is_clipped = false; | |
21 out->opacity = 1.f; | |
22 out->blend_mode = SkXfermode::kSrc_Mode; | |
23 out->sorting_context_id = 0; | |
24 } | |
25 | |
26 RenderPassPtr CreateDefaultPass(int id, const gfx::Rect& rect) { | |
27 RenderPassPtr pass = RenderPass::New(); | |
28 cc::RenderPassId render_pass_id; | |
29 render_pass_id.layer_id = 1; | |
30 render_pass_id.index = id; | |
31 pass->id = render_pass_id; | |
32 pass->output_rect = rect; | |
33 pass->damage_rect = rect; | |
34 pass->has_transparent_background = false; | |
35 return pass; | |
36 } | |
37 | |
38 } // namespace mojo | |
OLD | NEW |