1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/android/graphics/point.proto
3 
4 #include "protos/perfetto/trace/android/graphics/point.pb.h"
5 
6 #include <algorithm>
7 #include <cstdint>
8 
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15 
16 PROTOBUF_PRAGMA_INIT_SEG
17 
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20 
21 namespace perfetto {
22 namespace protos {
PointProto(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR PointProto::PointProto(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.x_)*/0
28   , /*decltype(_impl_.y_)*/0} {}
29 struct PointProtoDefaultTypeInternal {
PointProtoDefaultTypeInternalperfetto::protos::PointProtoDefaultTypeInternal30   PROTOBUF_CONSTEXPR PointProtoDefaultTypeInternal()
31       : _instance(::_pbi::ConstantInitialized{}) {}
~PointProtoDefaultTypeInternalperfetto::protos::PointProtoDefaultTypeInternal32   ~PointProtoDefaultTypeInternal() {}
33   union {  // NOLINT(misc-non-private-member-variables-in-classes)
34     PointProto _instance;
35   };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PointProtoDefaultTypeInternal _PointProto_default_instance_;
38 }  // namespace protos
39 }  // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42 
43 // ===================================================================
44 
45 class PointProto::_Internal {
46  public:
47   using HasBits = decltype(std::declval<PointProto>()._impl_._has_bits_);
set_has_x(HasBits * has_bits)48   static void set_has_x(HasBits* has_bits) {
49     (*has_bits)[0] |= 1u;
50   }
set_has_y(HasBits * has_bits)51   static void set_has_y(HasBits* has_bits) {
52     (*has_bits)[0] |= 2u;
53   }
54 };
55 
PointProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)56 PointProto::PointProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
57                          bool is_message_owned)
58   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
59   SharedCtor(arena, is_message_owned);
60   // @@protoc_insertion_point(arena_constructor:perfetto.protos.PointProto)
61 }
PointProto(const PointProto & from)62 PointProto::PointProto(const PointProto& from)
63   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
64   PointProto* const _this = this; (void)_this;
65   new (&_impl_) Impl_{
66       decltype(_impl_._has_bits_){from._impl_._has_bits_}
67     , /*decltype(_impl_._cached_size_)*/{}
68     , decltype(_impl_.x_){}
69     , decltype(_impl_.y_){}};
70 
71   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
72   ::memcpy(&_impl_.x_, &from._impl_.x_,
73     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.y_) -
74     reinterpret_cast<char*>(&_impl_.x_)) + sizeof(_impl_.y_));
75   // @@protoc_insertion_point(copy_constructor:perfetto.protos.PointProto)
76 }
77 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)78 inline void PointProto::SharedCtor(
79     ::_pb::Arena* arena, bool is_message_owned) {
80   (void)arena;
81   (void)is_message_owned;
82   new (&_impl_) Impl_{
83       decltype(_impl_._has_bits_){}
84     , /*decltype(_impl_._cached_size_)*/{}
85     , decltype(_impl_.x_){0}
86     , decltype(_impl_.y_){0}
87   };
88 }
89 
~PointProto()90 PointProto::~PointProto() {
91   // @@protoc_insertion_point(destructor:perfetto.protos.PointProto)
92   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
93   (void)arena;
94     return;
95   }
96   SharedDtor();
97 }
98 
SharedDtor()99 inline void PointProto::SharedDtor() {
100   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
101 }
102 
SetCachedSize(int size) const103 void PointProto::SetCachedSize(int size) const {
104   _impl_._cached_size_.Set(size);
105 }
106 
Clear()107 void PointProto::Clear() {
108 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PointProto)
109   ::uint32_t cached_has_bits = 0;
110   // Prevent compiler warnings about cached_has_bits being unused
111   (void) cached_has_bits;
112 
113   cached_has_bits = _impl_._has_bits_[0];
114   if (cached_has_bits & 0x00000003u) {
115     ::memset(&_impl_.x_, 0, static_cast<size_t>(
116         reinterpret_cast<char*>(&_impl_.y_) -
117         reinterpret_cast<char*>(&_impl_.x_)) + sizeof(_impl_.y_));
118   }
119   _impl_._has_bits_.Clear();
120   _internal_metadata_.Clear<std::string>();
121 }
122 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)123 const char* PointProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
124 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
125   _Internal::HasBits has_bits{};
126   while (!ctx->Done(&ptr)) {
127     ::uint32_t tag;
128     ptr = ::_pbi::ReadTag(ptr, &tag);
129     switch (tag >> 3) {
130       // optional int32 x = 1;
131       case 1:
132         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
133           _Internal::set_has_x(&has_bits);
134           _impl_.x_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
135           CHK_(ptr);
136         } else {
137           goto handle_unusual;
138         }
139         continue;
140       // optional int32 y = 2;
141       case 2:
142         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
143           _Internal::set_has_y(&has_bits);
144           _impl_.y_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
145           CHK_(ptr);
146         } else {
147           goto handle_unusual;
148         }
149         continue;
150       default:
151         goto handle_unusual;
152     }  // switch
153   handle_unusual:
154     if ((tag == 0) || ((tag & 7) == 4)) {
155       CHK_(ptr);
156       ctx->SetLastTag(tag);
157       goto message_done;
158     }
159     ptr = UnknownFieldParse(
160         tag,
161         _internal_metadata_.mutable_unknown_fields<std::string>(),
162         ptr, ctx);
163     CHK_(ptr != nullptr);
164   }  // while
165 message_done:
166   _impl_._has_bits_.Or(has_bits);
167   return ptr;
168 failure:
169   ptr = nullptr;
170   goto message_done;
171 #undef CHK_
172 }
173 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const174 ::uint8_t* PointProto::_InternalSerialize(
175     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
176   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PointProto)
177   ::uint32_t cached_has_bits = 0;
178   (void) cached_has_bits;
179 
180   cached_has_bits = _impl_._has_bits_[0];
181   // optional int32 x = 1;
182   if (cached_has_bits & 0x00000001u) {
183     target = stream->EnsureSpace(target);
184     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_x(), target);
185   }
186 
187   // optional int32 y = 2;
188   if (cached_has_bits & 0x00000002u) {
189     target = stream->EnsureSpace(target);
190     target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_y(), target);
191   }
192 
193   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
194     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
195         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
196   }
197   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PointProto)
198   return target;
199 }
200 
ByteSizeLong() const201 size_t PointProto::ByteSizeLong() const {
202 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PointProto)
203   size_t total_size = 0;
204 
205   ::uint32_t cached_has_bits = 0;
206   // Prevent compiler warnings about cached_has_bits being unused
207   (void) cached_has_bits;
208 
209   cached_has_bits = _impl_._has_bits_[0];
210   if (cached_has_bits & 0x00000003u) {
211     // optional int32 x = 1;
212     if (cached_has_bits & 0x00000001u) {
213       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_x());
214     }
215 
216     // optional int32 y = 2;
217     if (cached_has_bits & 0x00000002u) {
218       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_y());
219     }
220 
221   }
222   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
223     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
224   }
225   int cached_size = ::_pbi::ToCachedSize(total_size);
226   SetCachedSize(cached_size);
227   return total_size;
228 }
229 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)230 void PointProto::CheckTypeAndMergeFrom(
231     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
232   MergeFrom(*::_pbi::DownCast<const PointProto*>(
233       &from));
234 }
235 
MergeFrom(const PointProto & from)236 void PointProto::MergeFrom(const PointProto& from) {
237   PointProto* const _this = this;
238   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PointProto)
239   GOOGLE_DCHECK_NE(&from, _this);
240   ::uint32_t cached_has_bits = 0;
241   (void) cached_has_bits;
242 
243   cached_has_bits = from._impl_._has_bits_[0];
244   if (cached_has_bits & 0x00000003u) {
245     if (cached_has_bits & 0x00000001u) {
246       _this->_impl_.x_ = from._impl_.x_;
247     }
248     if (cached_has_bits & 0x00000002u) {
249       _this->_impl_.y_ = from._impl_.y_;
250     }
251     _this->_impl_._has_bits_[0] |= cached_has_bits;
252   }
253   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
254 }
255 
CopyFrom(const PointProto & from)256 void PointProto::CopyFrom(const PointProto& from) {
257 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PointProto)
258   if (&from == this) return;
259   Clear();
260   MergeFrom(from);
261 }
262 
IsInitialized() const263 bool PointProto::IsInitialized() const {
264   return true;
265 }
266 
InternalSwap(PointProto * other)267 void PointProto::InternalSwap(PointProto* other) {
268   using std::swap;
269   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
270   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
271   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
272       PROTOBUF_FIELD_OFFSET(PointProto, _impl_.y_)
273       + sizeof(PointProto::_impl_.y_)  // NOLINT
274       - PROTOBUF_FIELD_OFFSET(PointProto, _impl_.x_)>(
275           reinterpret_cast<char*>(&_impl_.x_),
276           reinterpret_cast<char*>(&other->_impl_.x_));
277 }
278 
GetTypeName() const279 std::string PointProto::GetTypeName() const {
280   return "perfetto.protos.PointProto";
281 }
282 
283 
284 // @@protoc_insertion_point(namespace_scope)
285 }  // namespace protos
286 }  // namespace perfetto
287 PROTOBUF_NAMESPACE_OPEN
288 template<> PROTOBUF_NOINLINE ::perfetto::protos::PointProto*
CreateMaybeMessage(Arena * arena)289 Arena::CreateMaybeMessage< ::perfetto::protos::PointProto >(Arena* arena) {
290   return Arena::CreateMessageInternal< ::perfetto::protos::PointProto >(arena);
291 }
292 PROTOBUF_NAMESPACE_CLOSE
293 
294 // @@protoc_insertion_point(global_scope)
295 #include <google/protobuf/port_undef.inc>
296