1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/android/graphics_frame_event.proto
3
4 #include "protos/perfetto/trace/android/graphics_frame_event.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 {
GraphicsFrameEvent_BufferEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR GraphicsFrameEvent_BufferEvent::GraphicsFrameEvent_BufferEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.layer_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.frame_number_)*/0u
29 , /*decltype(_impl_.type_)*/0
30 , /*decltype(_impl_.duration_ns_)*/::uint64_t{0u}
31 , /*decltype(_impl_.buffer_id_)*/0u} {}
32 struct GraphicsFrameEvent_BufferEventDefaultTypeInternal {
GraphicsFrameEvent_BufferEventDefaultTypeInternalperfetto::protos::GraphicsFrameEvent_BufferEventDefaultTypeInternal33 PROTOBUF_CONSTEXPR GraphicsFrameEvent_BufferEventDefaultTypeInternal()
34 : _instance(::_pbi::ConstantInitialized{}) {}
~GraphicsFrameEvent_BufferEventDefaultTypeInternalperfetto::protos::GraphicsFrameEvent_BufferEventDefaultTypeInternal35 ~GraphicsFrameEvent_BufferEventDefaultTypeInternal() {}
36 union { // NOLINT(misc-non-private-member-variables-in-classes)
37 GraphicsFrameEvent_BufferEvent _instance;
38 };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphicsFrameEvent_BufferEventDefaultTypeInternal _GraphicsFrameEvent_BufferEvent_default_instance_;
GraphicsFrameEvent(::_pbi::ConstantInitialized)41 PROTOBUF_CONSTEXPR GraphicsFrameEvent::GraphicsFrameEvent(
42 ::_pbi::ConstantInitialized): _impl_{
43 /*decltype(_impl_._has_bits_)*/{}
44 , /*decltype(_impl_._cached_size_)*/{}
45 , /*decltype(_impl_.buffer_event_)*/nullptr} {}
46 struct GraphicsFrameEventDefaultTypeInternal {
GraphicsFrameEventDefaultTypeInternalperfetto::protos::GraphicsFrameEventDefaultTypeInternal47 PROTOBUF_CONSTEXPR GraphicsFrameEventDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~GraphicsFrameEventDefaultTypeInternalperfetto::protos::GraphicsFrameEventDefaultTypeInternal49 ~GraphicsFrameEventDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 GraphicsFrameEvent _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphicsFrameEventDefaultTypeInternal _GraphicsFrameEvent_default_instance_;
55 } // namespace protos
56 } // namespace perfetto
57 namespace perfetto {
58 namespace protos {
GraphicsFrameEvent_BufferEventType_IsValid(int value)59 bool GraphicsFrameEvent_BufferEventType_IsValid(int value) {
60 switch (value) {
61 case 0:
62 case 1:
63 case 2:
64 case 3:
65 case 4:
66 case 5:
67 case 6:
68 case 7:
69 case 8:
70 case 9:
71 case 10:
72 case 11:
73 case 12:
74 case 13:
75 return true;
76 default:
77 return false;
78 }
79 }
80
81 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> GraphicsFrameEvent_BufferEventType_strings[14] = {};
82
83 static const char GraphicsFrameEvent_BufferEventType_names[] =
84 "ACQUIRE_FENCE"
85 "ATTACH"
86 "CANCEL"
87 "DEQUEUE"
88 "DETACH"
89 "FALLBACK_COMPOSITION"
90 "HWC_COMPOSITION_QUEUED"
91 "LATCH"
92 "MODIFY"
93 "POST"
94 "PRESENT_FENCE"
95 "QUEUE"
96 "RELEASE_FENCE"
97 "UNSPECIFIED";
98
99 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GraphicsFrameEvent_BufferEventType_entries[] = {
100 { {GraphicsFrameEvent_BufferEventType_names + 0, 13}, 4 },
101 { {GraphicsFrameEvent_BufferEventType_names + 13, 6}, 12 },
102 { {GraphicsFrameEvent_BufferEventType_names + 19, 6}, 13 },
103 { {GraphicsFrameEvent_BufferEventType_names + 25, 7}, 1 },
104 { {GraphicsFrameEvent_BufferEventType_names + 32, 6}, 11 },
105 { {GraphicsFrameEvent_BufferEventType_names + 38, 20}, 7 },
106 { {GraphicsFrameEvent_BufferEventType_names + 58, 22}, 6 },
107 { {GraphicsFrameEvent_BufferEventType_names + 80, 5}, 5 },
108 { {GraphicsFrameEvent_BufferEventType_names + 85, 6}, 10 },
109 { {GraphicsFrameEvent_BufferEventType_names + 91, 4}, 3 },
110 { {GraphicsFrameEvent_BufferEventType_names + 95, 13}, 8 },
111 { {GraphicsFrameEvent_BufferEventType_names + 108, 5}, 2 },
112 { {GraphicsFrameEvent_BufferEventType_names + 113, 13}, 9 },
113 { {GraphicsFrameEvent_BufferEventType_names + 126, 11}, 0 },
114 };
115
116 static const int GraphicsFrameEvent_BufferEventType_entries_by_number[] = {
117 13, // 0 -> UNSPECIFIED
118 3, // 1 -> DEQUEUE
119 11, // 2 -> QUEUE
120 9, // 3 -> POST
121 0, // 4 -> ACQUIRE_FENCE
122 7, // 5 -> LATCH
123 6, // 6 -> HWC_COMPOSITION_QUEUED
124 5, // 7 -> FALLBACK_COMPOSITION
125 10, // 8 -> PRESENT_FENCE
126 12, // 9 -> RELEASE_FENCE
127 8, // 10 -> MODIFY
128 4, // 11 -> DETACH
129 1, // 12 -> ATTACH
130 2, // 13 -> CANCEL
131 };
132
GraphicsFrameEvent_BufferEventType_Name(GraphicsFrameEvent_BufferEventType value)133 const std::string& GraphicsFrameEvent_BufferEventType_Name(
134 GraphicsFrameEvent_BufferEventType value) {
135 static const bool dummy =
136 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
137 GraphicsFrameEvent_BufferEventType_entries,
138 GraphicsFrameEvent_BufferEventType_entries_by_number,
139 14, GraphicsFrameEvent_BufferEventType_strings);
140 (void) dummy;
141 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
142 GraphicsFrameEvent_BufferEventType_entries,
143 GraphicsFrameEvent_BufferEventType_entries_by_number,
144 14, value);
145 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
146 GraphicsFrameEvent_BufferEventType_strings[idx].get();
147 }
GraphicsFrameEvent_BufferEventType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,GraphicsFrameEvent_BufferEventType * value)148 bool GraphicsFrameEvent_BufferEventType_Parse(
149 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GraphicsFrameEvent_BufferEventType* value) {
150 int int_value;
151 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
152 GraphicsFrameEvent_BufferEventType_entries, 14, name, &int_value);
153 if (success) {
154 *value = static_cast<GraphicsFrameEvent_BufferEventType>(int_value);
155 }
156 return success;
157 }
158 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
159 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::UNSPECIFIED;
160 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::DEQUEUE;
161 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::QUEUE;
162 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::POST;
163 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::ACQUIRE_FENCE;
164 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::LATCH;
165 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::HWC_COMPOSITION_QUEUED;
166 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::FALLBACK_COMPOSITION;
167 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::PRESENT_FENCE;
168 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::RELEASE_FENCE;
169 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::MODIFY;
170 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::DETACH;
171 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::ATTACH;
172 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::CANCEL;
173 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::BufferEventType_MIN;
174 constexpr GraphicsFrameEvent_BufferEventType GraphicsFrameEvent::BufferEventType_MAX;
175 constexpr int GraphicsFrameEvent::BufferEventType_ARRAYSIZE;
176 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
177
178 // ===================================================================
179
180 class GraphicsFrameEvent_BufferEvent::_Internal {
181 public:
182 using HasBits = decltype(std::declval<GraphicsFrameEvent_BufferEvent>()._impl_._has_bits_);
set_has_frame_number(HasBits * has_bits)183 static void set_has_frame_number(HasBits* has_bits) {
184 (*has_bits)[0] |= 2u;
185 }
set_has_type(HasBits * has_bits)186 static void set_has_type(HasBits* has_bits) {
187 (*has_bits)[0] |= 4u;
188 }
set_has_layer_name(HasBits * has_bits)189 static void set_has_layer_name(HasBits* has_bits) {
190 (*has_bits)[0] |= 1u;
191 }
set_has_duration_ns(HasBits * has_bits)192 static void set_has_duration_ns(HasBits* has_bits) {
193 (*has_bits)[0] |= 8u;
194 }
set_has_buffer_id(HasBits * has_bits)195 static void set_has_buffer_id(HasBits* has_bits) {
196 (*has_bits)[0] |= 16u;
197 }
198 };
199
GraphicsFrameEvent_BufferEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)200 GraphicsFrameEvent_BufferEvent::GraphicsFrameEvent_BufferEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
201 bool is_message_owned)
202 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
203 SharedCtor(arena, is_message_owned);
204 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GraphicsFrameEvent.BufferEvent)
205 }
GraphicsFrameEvent_BufferEvent(const GraphicsFrameEvent_BufferEvent & from)206 GraphicsFrameEvent_BufferEvent::GraphicsFrameEvent_BufferEvent(const GraphicsFrameEvent_BufferEvent& from)
207 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
208 GraphicsFrameEvent_BufferEvent* const _this = this; (void)_this;
209 new (&_impl_) Impl_{
210 decltype(_impl_._has_bits_){from._impl_._has_bits_}
211 , /*decltype(_impl_._cached_size_)*/{}
212 , decltype(_impl_.layer_name_){}
213 , decltype(_impl_.frame_number_){}
214 , decltype(_impl_.type_){}
215 , decltype(_impl_.duration_ns_){}
216 , decltype(_impl_.buffer_id_){}};
217
218 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
219 _impl_.layer_name_.InitDefault();
220 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
221 _impl_.layer_name_.Set("", GetArenaForAllocation());
222 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
223 if (from._internal_has_layer_name()) {
224 _this->_impl_.layer_name_.Set(from._internal_layer_name(),
225 _this->GetArenaForAllocation());
226 }
227 ::memcpy(&_impl_.frame_number_, &from._impl_.frame_number_,
228 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.buffer_id_) -
229 reinterpret_cast<char*>(&_impl_.frame_number_)) + sizeof(_impl_.buffer_id_));
230 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GraphicsFrameEvent.BufferEvent)
231 }
232
SharedCtor(::_pb::Arena * arena,bool is_message_owned)233 inline void GraphicsFrameEvent_BufferEvent::SharedCtor(
234 ::_pb::Arena* arena, bool is_message_owned) {
235 (void)arena;
236 (void)is_message_owned;
237 new (&_impl_) Impl_{
238 decltype(_impl_._has_bits_){}
239 , /*decltype(_impl_._cached_size_)*/{}
240 , decltype(_impl_.layer_name_){}
241 , decltype(_impl_.frame_number_){0u}
242 , decltype(_impl_.type_){0}
243 , decltype(_impl_.duration_ns_){::uint64_t{0u}}
244 , decltype(_impl_.buffer_id_){0u}
245 };
246 _impl_.layer_name_.InitDefault();
247 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
248 _impl_.layer_name_.Set("", GetArenaForAllocation());
249 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
250 }
251
~GraphicsFrameEvent_BufferEvent()252 GraphicsFrameEvent_BufferEvent::~GraphicsFrameEvent_BufferEvent() {
253 // @@protoc_insertion_point(destructor:perfetto.protos.GraphicsFrameEvent.BufferEvent)
254 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
255 (void)arena;
256 return;
257 }
258 SharedDtor();
259 }
260
SharedDtor()261 inline void GraphicsFrameEvent_BufferEvent::SharedDtor() {
262 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
263 _impl_.layer_name_.Destroy();
264 }
265
SetCachedSize(int size) const266 void GraphicsFrameEvent_BufferEvent::SetCachedSize(int size) const {
267 _impl_._cached_size_.Set(size);
268 }
269
Clear()270 void GraphicsFrameEvent_BufferEvent::Clear() {
271 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GraphicsFrameEvent.BufferEvent)
272 ::uint32_t cached_has_bits = 0;
273 // Prevent compiler warnings about cached_has_bits being unused
274 (void) cached_has_bits;
275
276 cached_has_bits = _impl_._has_bits_[0];
277 if (cached_has_bits & 0x00000001u) {
278 _impl_.layer_name_.ClearNonDefaultToEmpty();
279 }
280 if (cached_has_bits & 0x0000001eu) {
281 ::memset(&_impl_.frame_number_, 0, static_cast<size_t>(
282 reinterpret_cast<char*>(&_impl_.buffer_id_) -
283 reinterpret_cast<char*>(&_impl_.frame_number_)) + sizeof(_impl_.buffer_id_));
284 }
285 _impl_._has_bits_.Clear();
286 _internal_metadata_.Clear<std::string>();
287 }
288
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)289 const char* GraphicsFrameEvent_BufferEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
290 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
291 _Internal::HasBits has_bits{};
292 while (!ctx->Done(&ptr)) {
293 ::uint32_t tag;
294 ptr = ::_pbi::ReadTag(ptr, &tag);
295 switch (tag >> 3) {
296 // optional uint32 frame_number = 1;
297 case 1:
298 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
299 _Internal::set_has_frame_number(&has_bits);
300 _impl_.frame_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
301 CHK_(ptr);
302 } else {
303 goto handle_unusual;
304 }
305 continue;
306 // optional .perfetto.protos.GraphicsFrameEvent.BufferEventType type = 2;
307 case 2:
308 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
309 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
310 CHK_(ptr);
311 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::GraphicsFrameEvent_BufferEventType_IsValid(val))) {
312 _internal_set_type(static_cast<::perfetto::protos::GraphicsFrameEvent_BufferEventType>(val));
313 } else {
314 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
315 }
316 } else {
317 goto handle_unusual;
318 }
319 continue;
320 // optional string layer_name = 3;
321 case 3:
322 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
323 auto str = _internal_mutable_layer_name();
324 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
325 CHK_(ptr);
326 } else {
327 goto handle_unusual;
328 }
329 continue;
330 // optional uint64 duration_ns = 4;
331 case 4:
332 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
333 _Internal::set_has_duration_ns(&has_bits);
334 _impl_.duration_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
335 CHK_(ptr);
336 } else {
337 goto handle_unusual;
338 }
339 continue;
340 // optional uint32 buffer_id = 5;
341 case 5:
342 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
343 _Internal::set_has_buffer_id(&has_bits);
344 _impl_.buffer_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
345 CHK_(ptr);
346 } else {
347 goto handle_unusual;
348 }
349 continue;
350 default:
351 goto handle_unusual;
352 } // switch
353 handle_unusual:
354 if ((tag == 0) || ((tag & 7) == 4)) {
355 CHK_(ptr);
356 ctx->SetLastTag(tag);
357 goto message_done;
358 }
359 ptr = UnknownFieldParse(
360 tag,
361 _internal_metadata_.mutable_unknown_fields<std::string>(),
362 ptr, ctx);
363 CHK_(ptr != nullptr);
364 } // while
365 message_done:
366 _impl_._has_bits_.Or(has_bits);
367 return ptr;
368 failure:
369 ptr = nullptr;
370 goto message_done;
371 #undef CHK_
372 }
373
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const374 ::uint8_t* GraphicsFrameEvent_BufferEvent::_InternalSerialize(
375 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
376 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GraphicsFrameEvent.BufferEvent)
377 ::uint32_t cached_has_bits = 0;
378 (void) cached_has_bits;
379
380 cached_has_bits = _impl_._has_bits_[0];
381 // optional uint32 frame_number = 1;
382 if (cached_has_bits & 0x00000002u) {
383 target = stream->EnsureSpace(target);
384 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_frame_number(), target);
385 }
386
387 // optional .perfetto.protos.GraphicsFrameEvent.BufferEventType type = 2;
388 if (cached_has_bits & 0x00000004u) {
389 target = stream->EnsureSpace(target);
390 target = ::_pbi::WireFormatLite::WriteEnumToArray(
391 2, this->_internal_type(), target);
392 }
393
394 // optional string layer_name = 3;
395 if (cached_has_bits & 0x00000001u) {
396 target = stream->WriteStringMaybeAliased(
397 3, this->_internal_layer_name(), target);
398 }
399
400 // optional uint64 duration_ns = 4;
401 if (cached_has_bits & 0x00000008u) {
402 target = stream->EnsureSpace(target);
403 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_duration_ns(), target);
404 }
405
406 // optional uint32 buffer_id = 5;
407 if (cached_has_bits & 0x00000010u) {
408 target = stream->EnsureSpace(target);
409 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_buffer_id(), target);
410 }
411
412 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
413 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
414 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
415 }
416 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GraphicsFrameEvent.BufferEvent)
417 return target;
418 }
419
ByteSizeLong() const420 size_t GraphicsFrameEvent_BufferEvent::ByteSizeLong() const {
421 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GraphicsFrameEvent.BufferEvent)
422 size_t total_size = 0;
423
424 ::uint32_t cached_has_bits = 0;
425 // Prevent compiler warnings about cached_has_bits being unused
426 (void) cached_has_bits;
427
428 cached_has_bits = _impl_._has_bits_[0];
429 if (cached_has_bits & 0x0000001fu) {
430 // optional string layer_name = 3;
431 if (cached_has_bits & 0x00000001u) {
432 total_size += 1 +
433 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
434 this->_internal_layer_name());
435 }
436
437 // optional uint32 frame_number = 1;
438 if (cached_has_bits & 0x00000002u) {
439 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_frame_number());
440 }
441
442 // optional .perfetto.protos.GraphicsFrameEvent.BufferEventType type = 2;
443 if (cached_has_bits & 0x00000004u) {
444 total_size += 1 +
445 ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
446 }
447
448 // optional uint64 duration_ns = 4;
449 if (cached_has_bits & 0x00000008u) {
450 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_duration_ns());
451 }
452
453 // optional uint32 buffer_id = 5;
454 if (cached_has_bits & 0x00000010u) {
455 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_buffer_id());
456 }
457
458 }
459 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
460 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
461 }
462 int cached_size = ::_pbi::ToCachedSize(total_size);
463 SetCachedSize(cached_size);
464 return total_size;
465 }
466
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)467 void GraphicsFrameEvent_BufferEvent::CheckTypeAndMergeFrom(
468 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
469 MergeFrom(*::_pbi::DownCast<const GraphicsFrameEvent_BufferEvent*>(
470 &from));
471 }
472
MergeFrom(const GraphicsFrameEvent_BufferEvent & from)473 void GraphicsFrameEvent_BufferEvent::MergeFrom(const GraphicsFrameEvent_BufferEvent& from) {
474 GraphicsFrameEvent_BufferEvent* const _this = this;
475 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GraphicsFrameEvent.BufferEvent)
476 GOOGLE_DCHECK_NE(&from, _this);
477 ::uint32_t cached_has_bits = 0;
478 (void) cached_has_bits;
479
480 cached_has_bits = from._impl_._has_bits_[0];
481 if (cached_has_bits & 0x0000001fu) {
482 if (cached_has_bits & 0x00000001u) {
483 _this->_internal_set_layer_name(from._internal_layer_name());
484 }
485 if (cached_has_bits & 0x00000002u) {
486 _this->_impl_.frame_number_ = from._impl_.frame_number_;
487 }
488 if (cached_has_bits & 0x00000004u) {
489 _this->_impl_.type_ = from._impl_.type_;
490 }
491 if (cached_has_bits & 0x00000008u) {
492 _this->_impl_.duration_ns_ = from._impl_.duration_ns_;
493 }
494 if (cached_has_bits & 0x00000010u) {
495 _this->_impl_.buffer_id_ = from._impl_.buffer_id_;
496 }
497 _this->_impl_._has_bits_[0] |= cached_has_bits;
498 }
499 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
500 }
501
CopyFrom(const GraphicsFrameEvent_BufferEvent & from)502 void GraphicsFrameEvent_BufferEvent::CopyFrom(const GraphicsFrameEvent_BufferEvent& from) {
503 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GraphicsFrameEvent.BufferEvent)
504 if (&from == this) return;
505 Clear();
506 MergeFrom(from);
507 }
508
IsInitialized() const509 bool GraphicsFrameEvent_BufferEvent::IsInitialized() const {
510 return true;
511 }
512
InternalSwap(GraphicsFrameEvent_BufferEvent * other)513 void GraphicsFrameEvent_BufferEvent::InternalSwap(GraphicsFrameEvent_BufferEvent* other) {
514 using std::swap;
515 auto* lhs_arena = GetArenaForAllocation();
516 auto* rhs_arena = other->GetArenaForAllocation();
517 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
518 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
519 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
520 &_impl_.layer_name_, lhs_arena,
521 &other->_impl_.layer_name_, rhs_arena
522 );
523 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
524 PROTOBUF_FIELD_OFFSET(GraphicsFrameEvent_BufferEvent, _impl_.buffer_id_)
525 + sizeof(GraphicsFrameEvent_BufferEvent::_impl_.buffer_id_) // NOLINT
526 - PROTOBUF_FIELD_OFFSET(GraphicsFrameEvent_BufferEvent, _impl_.frame_number_)>(
527 reinterpret_cast<char*>(&_impl_.frame_number_),
528 reinterpret_cast<char*>(&other->_impl_.frame_number_));
529 }
530
GetTypeName() const531 std::string GraphicsFrameEvent_BufferEvent::GetTypeName() const {
532 return "perfetto.protos.GraphicsFrameEvent.BufferEvent";
533 }
534
535
536 // ===================================================================
537
538 class GraphicsFrameEvent::_Internal {
539 public:
540 using HasBits = decltype(std::declval<GraphicsFrameEvent>()._impl_._has_bits_);
541 static const ::perfetto::protos::GraphicsFrameEvent_BufferEvent& buffer_event(const GraphicsFrameEvent* msg);
set_has_buffer_event(HasBits * has_bits)542 static void set_has_buffer_event(HasBits* has_bits) {
543 (*has_bits)[0] |= 1u;
544 }
545 };
546
547 const ::perfetto::protos::GraphicsFrameEvent_BufferEvent&
buffer_event(const GraphicsFrameEvent * msg)548 GraphicsFrameEvent::_Internal::buffer_event(const GraphicsFrameEvent* msg) {
549 return *msg->_impl_.buffer_event_;
550 }
GraphicsFrameEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)551 GraphicsFrameEvent::GraphicsFrameEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
552 bool is_message_owned)
553 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
554 SharedCtor(arena, is_message_owned);
555 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GraphicsFrameEvent)
556 }
GraphicsFrameEvent(const GraphicsFrameEvent & from)557 GraphicsFrameEvent::GraphicsFrameEvent(const GraphicsFrameEvent& from)
558 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
559 GraphicsFrameEvent* const _this = this; (void)_this;
560 new (&_impl_) Impl_{
561 decltype(_impl_._has_bits_){from._impl_._has_bits_}
562 , /*decltype(_impl_._cached_size_)*/{}
563 , decltype(_impl_.buffer_event_){nullptr}};
564
565 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
566 if (from._internal_has_buffer_event()) {
567 _this->_impl_.buffer_event_ = new ::perfetto::protos::GraphicsFrameEvent_BufferEvent(*from._impl_.buffer_event_);
568 }
569 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GraphicsFrameEvent)
570 }
571
SharedCtor(::_pb::Arena * arena,bool is_message_owned)572 inline void GraphicsFrameEvent::SharedCtor(
573 ::_pb::Arena* arena, bool is_message_owned) {
574 (void)arena;
575 (void)is_message_owned;
576 new (&_impl_) Impl_{
577 decltype(_impl_._has_bits_){}
578 , /*decltype(_impl_._cached_size_)*/{}
579 , decltype(_impl_.buffer_event_){nullptr}
580 };
581 }
582
~GraphicsFrameEvent()583 GraphicsFrameEvent::~GraphicsFrameEvent() {
584 // @@protoc_insertion_point(destructor:perfetto.protos.GraphicsFrameEvent)
585 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
586 (void)arena;
587 return;
588 }
589 SharedDtor();
590 }
591
SharedDtor()592 inline void GraphicsFrameEvent::SharedDtor() {
593 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
594 if (this != internal_default_instance()) delete _impl_.buffer_event_;
595 }
596
SetCachedSize(int size) const597 void GraphicsFrameEvent::SetCachedSize(int size) const {
598 _impl_._cached_size_.Set(size);
599 }
600
Clear()601 void GraphicsFrameEvent::Clear() {
602 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GraphicsFrameEvent)
603 ::uint32_t cached_has_bits = 0;
604 // Prevent compiler warnings about cached_has_bits being unused
605 (void) cached_has_bits;
606
607 cached_has_bits = _impl_._has_bits_[0];
608 if (cached_has_bits & 0x00000001u) {
609 GOOGLE_DCHECK(_impl_.buffer_event_ != nullptr);
610 _impl_.buffer_event_->Clear();
611 }
612 _impl_._has_bits_.Clear();
613 _internal_metadata_.Clear<std::string>();
614 }
615
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)616 const char* GraphicsFrameEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
617 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
618 _Internal::HasBits has_bits{};
619 while (!ctx->Done(&ptr)) {
620 ::uint32_t tag;
621 ptr = ::_pbi::ReadTag(ptr, &tag);
622 switch (tag >> 3) {
623 // optional .perfetto.protos.GraphicsFrameEvent.BufferEvent buffer_event = 1;
624 case 1:
625 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
626 ptr = ctx->ParseMessage(_internal_mutable_buffer_event(), ptr);
627 CHK_(ptr);
628 } else {
629 goto handle_unusual;
630 }
631 continue;
632 default:
633 goto handle_unusual;
634 } // switch
635 handle_unusual:
636 if ((tag == 0) || ((tag & 7) == 4)) {
637 CHK_(ptr);
638 ctx->SetLastTag(tag);
639 goto message_done;
640 }
641 ptr = UnknownFieldParse(
642 tag,
643 _internal_metadata_.mutable_unknown_fields<std::string>(),
644 ptr, ctx);
645 CHK_(ptr != nullptr);
646 } // while
647 message_done:
648 _impl_._has_bits_.Or(has_bits);
649 return ptr;
650 failure:
651 ptr = nullptr;
652 goto message_done;
653 #undef CHK_
654 }
655
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const656 ::uint8_t* GraphicsFrameEvent::_InternalSerialize(
657 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
658 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GraphicsFrameEvent)
659 ::uint32_t cached_has_bits = 0;
660 (void) cached_has_bits;
661
662 cached_has_bits = _impl_._has_bits_[0];
663 // optional .perfetto.protos.GraphicsFrameEvent.BufferEvent buffer_event = 1;
664 if (cached_has_bits & 0x00000001u) {
665 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
666 InternalWriteMessage(1, _Internal::buffer_event(this),
667 _Internal::buffer_event(this).GetCachedSize(), target, stream);
668 }
669
670 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
671 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
672 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
673 }
674 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GraphicsFrameEvent)
675 return target;
676 }
677
ByteSizeLong() const678 size_t GraphicsFrameEvent::ByteSizeLong() const {
679 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GraphicsFrameEvent)
680 size_t total_size = 0;
681
682 ::uint32_t cached_has_bits = 0;
683 // Prevent compiler warnings about cached_has_bits being unused
684 (void) cached_has_bits;
685
686 // optional .perfetto.protos.GraphicsFrameEvent.BufferEvent buffer_event = 1;
687 cached_has_bits = _impl_._has_bits_[0];
688 if (cached_has_bits & 0x00000001u) {
689 total_size += 1 +
690 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
691 *_impl_.buffer_event_);
692 }
693
694 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
695 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
696 }
697 int cached_size = ::_pbi::ToCachedSize(total_size);
698 SetCachedSize(cached_size);
699 return total_size;
700 }
701
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)702 void GraphicsFrameEvent::CheckTypeAndMergeFrom(
703 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
704 MergeFrom(*::_pbi::DownCast<const GraphicsFrameEvent*>(
705 &from));
706 }
707
MergeFrom(const GraphicsFrameEvent & from)708 void GraphicsFrameEvent::MergeFrom(const GraphicsFrameEvent& from) {
709 GraphicsFrameEvent* const _this = this;
710 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GraphicsFrameEvent)
711 GOOGLE_DCHECK_NE(&from, _this);
712 ::uint32_t cached_has_bits = 0;
713 (void) cached_has_bits;
714
715 if (from._internal_has_buffer_event()) {
716 _this->_internal_mutable_buffer_event()->::perfetto::protos::GraphicsFrameEvent_BufferEvent::MergeFrom(
717 from._internal_buffer_event());
718 }
719 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
720 }
721
CopyFrom(const GraphicsFrameEvent & from)722 void GraphicsFrameEvent::CopyFrom(const GraphicsFrameEvent& from) {
723 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GraphicsFrameEvent)
724 if (&from == this) return;
725 Clear();
726 MergeFrom(from);
727 }
728
IsInitialized() const729 bool GraphicsFrameEvent::IsInitialized() const {
730 return true;
731 }
732
InternalSwap(GraphicsFrameEvent * other)733 void GraphicsFrameEvent::InternalSwap(GraphicsFrameEvent* other) {
734 using std::swap;
735 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
736 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
737 swap(_impl_.buffer_event_, other->_impl_.buffer_event_);
738 }
739
GetTypeName() const740 std::string GraphicsFrameEvent::GetTypeName() const {
741 return "perfetto.protos.GraphicsFrameEvent";
742 }
743
744
745 // @@protoc_insertion_point(namespace_scope)
746 } // namespace protos
747 } // namespace perfetto
748 PROTOBUF_NAMESPACE_OPEN
749 template<> PROTOBUF_NOINLINE ::perfetto::protos::GraphicsFrameEvent_BufferEvent*
CreateMaybeMessage(Arena * arena)750 Arena::CreateMaybeMessage< ::perfetto::protos::GraphicsFrameEvent_BufferEvent >(Arena* arena) {
751 return Arena::CreateMessageInternal< ::perfetto::protos::GraphicsFrameEvent_BufferEvent >(arena);
752 }
753 template<> PROTOBUF_NOINLINE ::perfetto::protos::GraphicsFrameEvent*
CreateMaybeMessage(Arena * arena)754 Arena::CreateMaybeMessage< ::perfetto::protos::GraphicsFrameEvent >(Arena* arena) {
755 return Arena::CreateMessageInternal< ::perfetto::protos::GraphicsFrameEvent >(arena);
756 }
757 PROTOBUF_NAMESPACE_CLOSE
758
759 // @@protoc_insertion_point(global_scope)
760 #include <google/protobuf/port_undef.inc>
761