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

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

Issue 2088603002: Implement RenderPass StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup 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
(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
OLDNEW
« no previous file with comments | « components/mus/public/cpp/surfaces/surfaces_utils.h ('k') | components/mus/public/cpp/surfaces/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698