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

Side by Side Diff: cc/ipc/shared_quad_state_struct_traits.h

Issue 2047963004: StructTraits optimizations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « cc/ipc/selection_struct_traits.h ('k') | cc/ipc/transferable_resource_struct_traits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ 5 #ifndef CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_
6 #define CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ 6 #define CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_
7 7
8 #include "cc/ipc/shared_quad_state.mojom.h" 8 #include "cc/ipc/shared_quad_state.mojom.h"
9 #include "cc/quads/shared_quad_state.h" 9 #include "cc/quads/shared_quad_state.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 template <> 13 template <>
14 struct StructTraits<cc::mojom::SharedQuadState, cc::SharedQuadState> { 14 struct StructTraits<cc::mojom::SharedQuadState, cc::SharedQuadState> {
15 static gfx::Transform quad_to_target_transform( 15 static const gfx::Transform& quad_to_target_transform(
16 const cc::SharedQuadState& sqs) { 16 const cc::SharedQuadState& sqs) {
17 return sqs.quad_to_target_transform; 17 return sqs.quad_to_target_transform;
18 } 18 }
19 19
20 static gfx::Size quad_layer_bounds(const cc::SharedQuadState& sqs) { 20 static gfx::Size quad_layer_bounds(const cc::SharedQuadState& sqs) {
21 return sqs.quad_layer_bounds; 21 return sqs.quad_layer_bounds;
22 } 22 }
23 23
24 static gfx::Rect visible_quad_layer_rect(const cc::SharedQuadState& sqs) { 24 static gfx::Rect visible_quad_layer_rect(const cc::SharedQuadState& sqs) {
25 return sqs.visible_quad_layer_rect; 25 return sqs.visible_quad_layer_rect;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return false; 58 return false;
59 out->blend_mode = static_cast<SkXfermode::Mode>(data.blend_mode()); 59 out->blend_mode = static_cast<SkXfermode::Mode>(data.blend_mode());
60 out->sorting_context_id = data.sorting_context_id(); 60 out->sorting_context_id = data.sorting_context_id();
61 return true; 61 return true;
62 } 62 }
63 }; 63 };
64 64
65 } // namespace mojo 65 } // namespace mojo
66 66
67 #endif // CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_ 67 #endif // CC_IPC_SHARED_QUAD_STATE_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « cc/ipc/selection_struct_traits.h ('k') | cc/ipc/transferable_resource_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698