OLD | NEW |
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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 break; | 563 break; |
564 case cc::DrawQuad::INVALID: | 564 case cc::DrawQuad::INVALID: |
565 break; | 565 break; |
566 } | 566 } |
567 } | 567 } |
568 l->append("])"); | 568 l->append("])"); |
569 } | 569 } |
570 | 570 |
571 void ParamTraits<cc::SurfaceId>::GetSize(base::PickleSizer* s, | 571 void ParamTraits<cc::SurfaceId>::GetSize(base::PickleSizer* s, |
572 const param_type& p) { | 572 const param_type& p) { |
573 GetParamSize(s, p.id_namespace()); | 573 GetParamSize(s, p.gpu_id()); |
| 574 GetParamSize(s, p.client_id()); |
574 GetParamSize(s, p.local_id()); | 575 GetParamSize(s, p.local_id()); |
575 GetParamSize(s, p.nonce()); | 576 GetParamSize(s, p.nonce()); |
576 } | 577 } |
577 | 578 |
578 void ParamTraits<cc::SurfaceId>::Write(base::Pickle* m, const param_type& p) { | 579 void ParamTraits<cc::SurfaceId>::Write(base::Pickle* m, const param_type& p) { |
579 WriteParam(m, p.id_namespace()); | 580 WriteParam(m, p.gpu_id()); |
| 581 WriteParam(m, p.client_id()); |
580 WriteParam(m, p.local_id()); | 582 WriteParam(m, p.local_id()); |
581 WriteParam(m, p.nonce()); | 583 WriteParam(m, p.nonce()); |
582 } | 584 } |
583 | 585 |
584 bool ParamTraits<cc::SurfaceId>::Read(const base::Pickle* m, | 586 bool ParamTraits<cc::SurfaceId>::Read(const base::Pickle* m, |
585 base::PickleIterator* iter, | 587 base::PickleIterator* iter, |
586 param_type* p) { | 588 param_type* p) { |
587 uint32_t id_namespace; | 589 uint32_t gpu_id; |
588 if (!ReadParam(m, iter, &id_namespace)) | 590 if (!ReadParam(m, iter, &gpu_id)) |
| 591 return false; |
| 592 |
| 593 uint32_t client_id; |
| 594 if (!ReadParam(m, iter, &client_id)) |
589 return false; | 595 return false; |
590 | 596 |
591 uint32_t local_id; | 597 uint32_t local_id; |
592 if (!ReadParam(m, iter, &local_id)) | 598 if (!ReadParam(m, iter, &local_id)) |
593 return false; | 599 return false; |
594 | 600 |
595 uint64_t nonce; | 601 uint64_t nonce; |
596 if (!ReadParam(m, iter, &nonce)) | 602 if (!ReadParam(m, iter, &nonce)) |
597 return false; | 603 return false; |
598 | 604 |
599 *p = cc::SurfaceId(id_namespace, local_id, nonce); | 605 *p = cc::SurfaceId(gpu_id, client_id, local_id, nonce); |
600 return true; | 606 return true; |
601 } | 607 } |
602 | 608 |
603 void ParamTraits<cc::SurfaceId>::Log(const param_type& p, std::string* l) { | 609 void ParamTraits<cc::SurfaceId>::Log(const param_type& p, std::string* l) { |
604 l->append("SurfaceId("); | 610 l->append("SurfaceId("); |
605 LogParam(p.id_namespace(), l); | 611 LogParam(p.gpu_id(), l); |
| 612 l->append(", "); |
| 613 LogParam(p.client_id(), l); |
606 l->append(", "); | 614 l->append(", "); |
607 LogParam(p.local_id(), l); | 615 LogParam(p.local_id(), l); |
608 l->append(", "); | 616 l->append(", "); |
609 LogParam(p.nonce(), l); | 617 LogParam(p.nonce(), l); |
610 l->append(")"); | 618 l->append(")"); |
611 } | 619 } |
612 | 620 |
613 namespace { | 621 namespace { |
614 enum CompositorFrameType { | 622 enum CompositorFrameType { |
615 NO_FRAME, | 623 NO_FRAME, |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ | 952 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ |
945 #include "cc/ipc/cc_param_traits_macros.h" | 953 #include "cc/ipc/cc_param_traits_macros.h" |
946 } // namespace IPC | 954 } // namespace IPC |
947 | 955 |
948 // Generate param traits log methods. | 956 // Generate param traits log methods. |
949 #include "ipc/param_traits_log_macros.h" | 957 #include "ipc/param_traits_log_macros.h" |
950 namespace IPC { | 958 namespace IPC { |
951 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ | 959 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ |
952 #include "cc/ipc/cc_param_traits_macros.h" | 960 #include "cc/ipc/cc_param_traits_macros.h" |
953 } // namespace IPC | 961 } // namespace IPC |
OLD | NEW |