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

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

Issue 2028573003: Implement gfx::Transform StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing build file 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/mojo/transform_type_converters.h"
10 #include "ui/gfx/transform.h" 9 #include "ui/gfx/transform.h"
11 10
12 using mus::mojom::Pass; 11 using mus::mojom::Pass;
13 using mus::mojom::PassPtr; 12 using mus::mojom::PassPtr;
14 using mus::mojom::SharedQuadState; 13 using mus::mojom::SharedQuadState;
15 using mus::mojom::SharedQuadStatePtr; 14 using mus::mojom::SharedQuadStatePtr;
16 15
17 namespace mojo { 16 namespace mojo {
18 17
19 SharedQuadStatePtr CreateDefaultSQS(const gfx::Size& size) { 18 SharedQuadStatePtr CreateDefaultSQS(const gfx::Size& size) {
20 SharedQuadStatePtr sqs = SharedQuadState::New(); 19 SharedQuadStatePtr sqs = SharedQuadState::New();
21 sqs->quad_to_target_transform = Transform::From(gfx::Transform());
22 sqs->quad_layer_bounds = size; 20 sqs->quad_layer_bounds = size;
23 sqs->visible_quad_layer_rect = gfx::Rect(size); 21 sqs->visible_quad_layer_rect = gfx::Rect(size);
24 sqs->clip_rect = gfx::Rect(size); 22 sqs->clip_rect = gfx::Rect(size);
25 sqs->is_clipped = false; 23 sqs->is_clipped = false;
26 sqs->opacity = 1.f; 24 sqs->opacity = 1.f;
27 sqs->blend_mode = mus::mojom::SkXfermode::kSrc_Mode; 25 sqs->blend_mode = mus::mojom::SkXfermode::kSrc_Mode;
28 sqs->sorting_context_id = 0; 26 sqs->sorting_context_id = 0;
29 return sqs; 27 return sqs;
30 } 28 }
31 29
32 PassPtr CreateDefaultPass(int id, const gfx::Rect& rect) { 30 PassPtr CreateDefaultPass(int id, const gfx::Rect& rect) {
33 PassPtr pass = Pass::New(); 31 PassPtr pass = Pass::New();
34 cc::RenderPassId render_pass_id; 32 cc::RenderPassId render_pass_id;
35 render_pass_id.layer_id = 1; 33 render_pass_id.layer_id = 1;
36 render_pass_id.index = id; 34 render_pass_id.index = id;
37 pass->id = render_pass_id; 35 pass->id = render_pass_id;
38 pass->output_rect = rect; 36 pass->output_rect = rect;
39 pass->damage_rect = rect; 37 pass->damage_rect = rect;
40 pass->transform_to_root_target = Transform::From(gfx::Transform());
41 pass->has_transparent_background = false; 38 pass->has_transparent_background = false;
42 return pass; 39 return pass;
43 } 40 }
44 41
45 } // namespace mojo 42 } // namespace mojo
OLDNEW
« no previous file with comments | « components/mus/public/cpp/surfaces/surfaces_type_converters.cc ('k') | components/mus/public/cpp/surfaces/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698