1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/android/graphics/rect.proto
3 
4 #include "protos/perfetto/trace/android/graphics/rect.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 {
RectProto(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR RectProto::RectProto(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.left_)*/0
28   , /*decltype(_impl_.top_)*/0
29   , /*decltype(_impl_.right_)*/0
30   , /*decltype(_impl_.bottom_)*/0} {}
31 struct RectProtoDefaultTypeInternal {
RectProtoDefaultTypeInternalperfetto::protos::RectProtoDefaultTypeInternal32   PROTOBUF_CONSTEXPR RectProtoDefaultTypeInternal()
33       : _instance(::_pbi::ConstantInitialized{}) {}
~RectProtoDefaultTypeInternalperfetto::protos::RectProtoDefaultTypeInternal34   ~RectProtoDefaultTypeInternal() {}
35   union {  // NOLINT(misc-non-private-member-variables-in-classes)
36     RectProto _instance;
37   };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RectProtoDefaultTypeInternal _RectProto_default_instance_;
40 }  // namespace protos
41 }  // namespace perfetto
42 namespace perfetto {
43 namespace protos {
44 
45 // ===================================================================
46 
47 class RectProto::_Internal {
48  public:
49   using HasBits = decltype(std::declval<RectProto>()._impl_._has_bits_);
set_has_left(HasBits * has_bits)50   static void set_has_left(HasBits* has_bits) {
51     (*has_bits)[0] |= 1u;
52   }
set_has_top(HasBits * has_bits)53   static void set_has_top(HasBits* has_bits) {
54     (*has_bits)[0] |= 2u;
55   }
set_has_right(HasBits * has_bits)56   static void set_has_right(HasBits* has_bits) {
57     (*has_bits)[0] |= 4u;
58   }
set_has_bottom(HasBits * has_bits)59   static void set_has_bottom(HasBits* has_bits) {
60     (*has_bits)[0] |= 8u;
61   }
62 };
63 
RectProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)64 RectProto::RectProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
65                          bool is_message_owned)
66   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
67   SharedCtor(arena, is_message_owned);
68   // @@protoc_insertion_point(arena_constructor:perfetto.protos.RectProto)
69 }
RectProto(const RectProto & from)70 RectProto::RectProto(const RectProto& from)
71   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
72   RectProto* const _this = this; (void)_this;
73   new (&_impl_) Impl_{
74       decltype(_impl_._has_bits_){from._impl_._has_bits_}
75     , /*decltype(_impl_._cached_size_)*/{}
76     , decltype(_impl_.left_){}
77     , decltype(_impl_.top_){}
78     , decltype(_impl_.right_){}
79     , decltype(_impl_.bottom_){}};
80 
81   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
82   ::memcpy(&_impl_.left_, &from._impl_.left_,
83     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.bottom_) -
84     reinterpret_cast<char*>(&_impl_.left_)) + sizeof(_impl_.bottom_));
85   // @@protoc_insertion_point(copy_constructor:perfetto.protos.RectProto)
86 }
87 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)88 inline void RectProto::SharedCtor(
89     ::_pb::Arena* arena, bool is_message_owned) {
90   (void)arena;
91   (void)is_message_owned;
92   new (&_impl_) Impl_{
93       decltype(_impl_._has_bits_){}
94     , /*decltype(_impl_._cached_size_)*/{}
95     , decltype(_impl_.left_){0}
96     , decltype(_impl_.top_){0}
97     , decltype(_impl_.right_){0}
98     , decltype(_impl_.bottom_){0}
99   };
100 }
101 
~RectProto()102 RectProto::~RectProto() {
103   // @@protoc_insertion_point(destructor:perfetto.protos.RectProto)
104   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
105   (void)arena;
106     return;
107   }
108   SharedDtor();
109 }
110 
SharedDtor()111 inline void RectProto::SharedDtor() {
112   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
113 }
114 
SetCachedSize(int size) const115 void RectProto::SetCachedSize(int size) const {
116   _impl_._cached_size_.Set(size);
117 }
118 
Clear()119 void RectProto::Clear() {
120 // @@protoc_insertion_point(message_clear_start:perfetto.protos.RectProto)
121   ::uint32_t cached_has_bits = 0;
122   // Prevent compiler warnings about cached_has_bits being unused
123   (void) cached_has_bits;
124 
125   cached_has_bits = _impl_._has_bits_[0];
126   if (cached_has_bits & 0x0000000fu) {
127     ::memset(&_impl_.left_, 0, static_cast<size_t>(
128         reinterpret_cast<char*>(&_impl_.bottom_) -
129         reinterpret_cast<char*>(&_impl_.left_)) + sizeof(_impl_.bottom_));
130   }
131   _impl_._has_bits_.Clear();
132   _internal_metadata_.Clear<std::string>();
133 }
134 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)135 const char* RectProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
136 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
137   _Internal::HasBits has_bits{};
138   while (!ctx->Done(&ptr)) {
139     ::uint32_t tag;
140     ptr = ::_pbi::ReadTag(ptr, &tag);
141     switch (tag >> 3) {
142       // optional int32 left = 1;
143       case 1:
144         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
145           _Internal::set_has_left(&has_bits);
146           _impl_.left_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
147           CHK_(ptr);
148         } else {
149           goto handle_unusual;
150         }
151         continue;
152       // optional int32 top = 2;
153       case 2:
154         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
155           _Internal::set_has_top(&has_bits);
156           _impl_.top_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
157           CHK_(ptr);
158         } else {
159           goto handle_unusual;
160         }
161         continue;
162       // optional int32 right = 3;
163       case 3:
164         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
165           _Internal::set_has_right(&has_bits);
166           _impl_.right_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
167           CHK_(ptr);
168         } else {
169           goto handle_unusual;
170         }
171         continue;
172       // optional int32 bottom = 4;
173       case 4:
174         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
175           _Internal::set_has_bottom(&has_bits);
176           _impl_.bottom_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
177           CHK_(ptr);
178         } else {
179           goto handle_unusual;
180         }
181         continue;
182       default:
183         goto handle_unusual;
184     }  // switch
185   handle_unusual:
186     if ((tag == 0) || ((tag & 7) == 4)) {
187       CHK_(ptr);
188       ctx->SetLastTag(tag);
189       goto message_done;
190     }
191     ptr = UnknownFieldParse(
192         tag,
193         _internal_metadata_.mutable_unknown_fields<std::string>(),
194         ptr, ctx);
195     CHK_(ptr != nullptr);
196   }  // while
197 message_done:
198   _impl_._has_bits_.Or(has_bits);
199   return ptr;
200 failure:
201   ptr = nullptr;
202   goto message_done;
203 #undef CHK_
204 }
205 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const206 ::uint8_t* RectProto::_InternalSerialize(
207     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
208   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.RectProto)
209   ::uint32_t cached_has_bits = 0;
210   (void) cached_has_bits;
211 
212   cached_has_bits = _impl_._has_bits_[0];
213   // optional int32 left = 1;
214   if (cached_has_bits & 0x00000001u) {
215     target = stream->EnsureSpace(target);
216     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_left(), target);
217   }
218 
219   // optional int32 top = 2;
220   if (cached_has_bits & 0x00000002u) {
221     target = stream->EnsureSpace(target);
222     target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_top(), target);
223   }
224 
225   // optional int32 right = 3;
226   if (cached_has_bits & 0x00000004u) {
227     target = stream->EnsureSpace(target);
228     target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_right(), target);
229   }
230 
231   // optional int32 bottom = 4;
232   if (cached_has_bits & 0x00000008u) {
233     target = stream->EnsureSpace(target);
234     target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_bottom(), target);
235   }
236 
237   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
238     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
239         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
240   }
241   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.RectProto)
242   return target;
243 }
244 
ByteSizeLong() const245 size_t RectProto::ByteSizeLong() const {
246 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.RectProto)
247   size_t total_size = 0;
248 
249   ::uint32_t cached_has_bits = 0;
250   // Prevent compiler warnings about cached_has_bits being unused
251   (void) cached_has_bits;
252 
253   cached_has_bits = _impl_._has_bits_[0];
254   if (cached_has_bits & 0x0000000fu) {
255     // optional int32 left = 1;
256     if (cached_has_bits & 0x00000001u) {
257       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_left());
258     }
259 
260     // optional int32 top = 2;
261     if (cached_has_bits & 0x00000002u) {
262       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_top());
263     }
264 
265     // optional int32 right = 3;
266     if (cached_has_bits & 0x00000004u) {
267       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_right());
268     }
269 
270     // optional int32 bottom = 4;
271     if (cached_has_bits & 0x00000008u) {
272       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_bottom());
273     }
274 
275   }
276   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
277     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
278   }
279   int cached_size = ::_pbi::ToCachedSize(total_size);
280   SetCachedSize(cached_size);
281   return total_size;
282 }
283 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)284 void RectProto::CheckTypeAndMergeFrom(
285     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
286   MergeFrom(*::_pbi::DownCast<const RectProto*>(
287       &from));
288 }
289 
MergeFrom(const RectProto & from)290 void RectProto::MergeFrom(const RectProto& from) {
291   RectProto* const _this = this;
292   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.RectProto)
293   GOOGLE_DCHECK_NE(&from, _this);
294   ::uint32_t cached_has_bits = 0;
295   (void) cached_has_bits;
296 
297   cached_has_bits = from._impl_._has_bits_[0];
298   if (cached_has_bits & 0x0000000fu) {
299     if (cached_has_bits & 0x00000001u) {
300       _this->_impl_.left_ = from._impl_.left_;
301     }
302     if (cached_has_bits & 0x00000002u) {
303       _this->_impl_.top_ = from._impl_.top_;
304     }
305     if (cached_has_bits & 0x00000004u) {
306       _this->_impl_.right_ = from._impl_.right_;
307     }
308     if (cached_has_bits & 0x00000008u) {
309       _this->_impl_.bottom_ = from._impl_.bottom_;
310     }
311     _this->_impl_._has_bits_[0] |= cached_has_bits;
312   }
313   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
314 }
315 
CopyFrom(const RectProto & from)316 void RectProto::CopyFrom(const RectProto& from) {
317 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.RectProto)
318   if (&from == this) return;
319   Clear();
320   MergeFrom(from);
321 }
322 
IsInitialized() const323 bool RectProto::IsInitialized() const {
324   return true;
325 }
326 
InternalSwap(RectProto * other)327 void RectProto::InternalSwap(RectProto* other) {
328   using std::swap;
329   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
330   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
331   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
332       PROTOBUF_FIELD_OFFSET(RectProto, _impl_.bottom_)
333       + sizeof(RectProto::_impl_.bottom_)  // NOLINT
334       - PROTOBUF_FIELD_OFFSET(RectProto, _impl_.left_)>(
335           reinterpret_cast<char*>(&_impl_.left_),
336           reinterpret_cast<char*>(&other->_impl_.left_));
337 }
338 
GetTypeName() const339 std::string RectProto::GetTypeName() const {
340   return "perfetto.protos.RectProto";
341 }
342 
343 
344 // @@protoc_insertion_point(namespace_scope)
345 }  // namespace protos
346 }  // namespace perfetto
347 PROTOBUF_NAMESPACE_OPEN
348 template<> PROTOBUF_NOINLINE ::perfetto::protos::RectProto*
CreateMaybeMessage(Arena * arena)349 Arena::CreateMaybeMessage< ::perfetto::protos::RectProto >(Arena* arena) {
350   return Arena::CreateMessageInternal< ::perfetto::protos::RectProto >(arena);
351 }
352 PROTOBUF_NAMESPACE_CLOSE
353 
354 // @@protoc_insertion_point(global_scope)
355 #include <google/protobuf/port_undef.inc>
356