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

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

Issue 2032643002: Implement cc::SharedQuadState StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to uint 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 mus::mojom::Pass; 11 using mus::mojom::Pass;
12 using mus::mojom::PassPtr; 12 using mus::mojom::PassPtr;
13 using mus::mojom::SharedQuadState;
14 using mus::mojom::SharedQuadStatePtr;
15 13
16 namespace mojo { 14 namespace mojo {
17 15
18 SharedQuadStatePtr CreateDefaultSQS(const gfx::Size& size) { 16 cc::SharedQuadState CreateDefaultSQS(const gfx::Size& size) {
19 SharedQuadStatePtr sqs = SharedQuadState::New(); 17 cc::SharedQuadState sqs;
20 sqs->quad_layer_bounds = size; 18 sqs.quad_layer_bounds = size;
21 sqs->visible_quad_layer_rect = gfx::Rect(size); 19 sqs.visible_quad_layer_rect = gfx::Rect(size);
22 sqs->clip_rect = gfx::Rect(size); 20 sqs.clip_rect = gfx::Rect(size);
23 sqs->is_clipped = false; 21 sqs.is_clipped = false;
24 sqs->opacity = 1.f; 22 sqs.opacity = 1.f;
25 sqs->blend_mode = mus::mojom::SkXfermode::kSrc_Mode; 23 sqs.blend_mode = SkXfermode::kSrc_Mode;
26 sqs->sorting_context_id = 0; 24 sqs.sorting_context_id = 0;
27 return sqs; 25 return sqs;
28 } 26 }
29 27
30 PassPtr CreateDefaultPass(int id, const gfx::Rect& rect) { 28 PassPtr CreateDefaultPass(int id, const gfx::Rect& rect) {
31 PassPtr pass = Pass::New(); 29 PassPtr pass = Pass::New();
32 cc::RenderPassId render_pass_id; 30 cc::RenderPassId render_pass_id;
33 render_pass_id.layer_id = 1; 31 render_pass_id.layer_id = 1;
34 render_pass_id.index = id; 32 render_pass_id.index = id;
35 pass->id = render_pass_id; 33 pass->id = render_pass_id;
36 pass->output_rect = rect; 34 pass->output_rect = rect;
37 pass->damage_rect = rect; 35 pass->damage_rect = rect;
38 pass->has_transparent_background = false; 36 pass->has_transparent_background = false;
39 return pass; 37 return pass;
40 } 38 }
41 39
42 } // namespace mojo 40 } // 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