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

Side by Side Diff: cc/ipc/cc_param_traits.cc

Issue 2324723002: Speed up quad deserialization. (Closed)
Patch Set: comment added Created 4 years, 3 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 | « no previous file | cc/quads/draw_quad_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "cc/ipc/cc_param_traits.h" 5 #include "cc/ipc/cc_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 size_t to_reserve = sizeof(cc::RenderPass); 398 size_t to_reserve = sizeof(cc::RenderPass);
399 399
400 // Whether the quad points to a new shared quad state for each quad. 400 // Whether the quad points to a new shared quad state for each quad.
401 to_reserve += p.quad_list.size() * sizeof(bool); 401 to_reserve += p.quad_list.size() * sizeof(bool);
402 402
403 // Shared quad state is only written when a quad contains a shared quad state 403 // Shared quad state is only written when a quad contains a shared quad state
404 // that has not been written. 404 // that has not been written.
405 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState); 405 to_reserve += p.shared_quad_state_list.size() * sizeof(cc::SharedQuadState);
406 406
407 // The largest quad type, verified by a unit test. 407 // The largest quad type, verified by a unit test.
408 to_reserve += p.quad_list.size() * cc::LargestDrawQuadSize(); 408 to_reserve += p.quad_list.size() * cc::LargestDrawQuadSerializedSize();
409 return to_reserve; 409 return to_reserve;
410 } 410 }
411 411
412 template <typename QuadType> 412 template <typename QuadType>
413 static cc::DrawQuad* ReadDrawQuad(const base::Pickle* m, 413 static cc::DrawQuad* ReadDrawQuad(const base::Pickle* m,
414 base::PickleIterator* iter, 414 base::PickleIterator* iter,
415 cc::RenderPass* render_pass) { 415 cc::RenderPass* render_pass) {
416 QuadType* quad = render_pass->CreateAndAppendDrawQuad<QuadType>(); 416 QuadType* quad = render_pass->CreateAndAppendDrawQuad<QuadType>();
417 if (!ReadParam(m, iter, quad)) 417 if (!ReadParam(m, iter, quad))
418 return NULL; 418 return NULL;
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 969 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
970 #include "cc/ipc/cc_param_traits_macros.h" 970 #include "cc/ipc/cc_param_traits_macros.h"
971 } // namespace IPC 971 } // namespace IPC
972 972
973 // Generate param traits log methods. 973 // Generate param traits log methods.
974 #include "ipc/param_traits_log_macros.h" 974 #include "ipc/param_traits_log_macros.h"
975 namespace IPC { 975 namespace IPC {
976 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 976 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
977 #include "cc/ipc/cc_param_traits_macros.h" 977 #include "cc/ipc/cc_param_traits_macros.h"
978 } // namespace IPC 978 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698