Lines Matching refs:proto

55     perfetto::protos::TransactionState proto;  in toProto()  local
56 proto.set_pid(t.originPid); in toProto()
57 proto.set_uid(t.originUid); in toProto()
58 proto.set_vsync_id(t.frameTimelineInfo.vsyncId); in toProto()
59 proto.set_input_event_id(t.frameTimelineInfo.inputEventId); in toProto()
60 proto.set_post_time(t.postTime); in toProto()
61 proto.set_transaction_id(t.id); in toProto()
63 proto.mutable_layer_changes()->Reserve(static_cast<int32_t>(t.states.size())); in toProto()
65 proto.mutable_layer_changes()->Add(std::move(toProto(layerState))); in toProto()
68 proto.mutable_display_changes()->Reserve(static_cast<int32_t>(t.displays.size())); in toProto()
70 proto.mutable_display_changes()->Add(std::move(toProto(displayState))); in toProto()
73 proto.mutable_merged_transaction_ids()->Reserve( in toProto()
76 proto.mutable_merged_transaction_ids()->Add(mergedTransactionId); in toProto()
79 return proto; in toProto()
84 perfetto::protos::TransactionState proto; in toProto() local
85 proto.mutable_layer_changes()->Reserve(static_cast<int32_t>(states.size())); in toProto()
89 proto.mutable_layer_changes()->Add(std::move(layerProto)); in toProto()
91 return proto; in toProto()
96 perfetto::protos::LayerState proto; in toProto() local
98 proto.set_layer_id(resolvedComposerState.layerId); in toProto()
99 proto.set_what(layer.what); in toProto()
102 proto.set_x(layer.x); in toProto()
103 proto.set_y(layer.y); in toProto()
106 proto.set_z(layer.z); in toProto()
110 proto.set_layer_stack(layer.layerStack.id); in toProto()
113 proto.set_flags(layer.flags); in toProto()
114 proto.set_mask(layer.mask); in toProto()
117 perfetto::protos::LayerState_Matrix22* matrixProto = proto.mutable_matrix(); in toProto()
124 proto.set_corner_radius(layer.cornerRadius); in toProto()
127 proto.set_background_blur_radius(layer.backgroundBlurRadius); in toProto()
131 proto.set_alpha(layer.color.a); in toProto()
135 perfetto::protos::LayerState_Color3* colorProto = proto.mutable_color(); in toProto()
141 LayerProtoHelper::writeToProto(layer.transparentRegion, proto.mutable_transparent_region()); in toProto()
144 proto.set_transform(layer.bufferTransform); in toProto()
147 proto.set_transform_to_display_inverse(layer.transformToDisplayInverse); in toProto()
150 LayerProtoHelper::writeToProto(layer.crop, proto.mutable_crop()); in toProto()
153 perfetto::protos::LayerState_BufferData* bufferProto = proto.mutable_buffer_data(); in toProto()
168 proto.set_has_sideband_stream(layer.sidebandStream != nullptr); in toProto()
172 proto.set_api(layer.api); in toProto()
176 LayerProtoHelper::writeToProto(layer.colorTransform, proto.mutable_color_transform()); in toProto()
180 LayerProtoHelper::writeToProto(region, proto.add_blur_regions()); in toProto()
185 proto.set_parent_id(resolvedComposerState.parentId); in toProto()
188 proto.set_relative_parent_id(resolvedComposerState.relativeParentId); in toProto()
189 proto.set_z(layer.z); in toProto()
196 proto.mutable_window_info_handle(); in toProto()
222 proto.set_bg_color_alpha(layer.bgColor.a); in toProto()
223 proto.set_bg_color_dataspace(static_cast<int32_t>(layer.bgColorDataspace)); in toProto()
224 perfetto::protos::LayerState_Color3* colorProto = proto.mutable_color(); in toProto()
230 proto.set_color_space_agnostic(layer.colorSpaceAgnostic); in toProto()
233 proto.set_shadow_radius(layer.shadowRadius); in toProto()
236 proto.set_frame_rate_selection_priority(layer.frameRateSelectionPriority); in toProto()
239 proto.set_frame_rate(layer.frameRate); in toProto()
240 proto.set_frame_rate_compatibility(layer.frameRateCompatibility); in toProto()
241 proto.set_change_frame_rate_strategy(layer.changeFrameRateStrategy); in toProto()
244 proto.set_fixed_transform_hint(layer.fixedTransformHint); in toProto()
247 proto.set_auto_refresh(layer.autoRefresh); in toProto()
250 proto.set_is_trusted_overlay(layer.trustedOverlay == gui::TrustedOverlay::ENABLED); in toProto()
254 LayerProtoHelper::writeToProto(layer.bufferCrop, proto.mutable_buffer_crop()); in toProto()
257 LayerProtoHelper::writeToProto(layer.destinationFrame, proto.mutable_destination_frame()); in toProto()
260 proto.set_drop_input_mode( in toProto()
263 return proto; in toProto()
267 perfetto::protos::DisplayState proto; in toProto() local
268 proto.set_what(display.what); in toProto()
269 proto.set_id(mMapper->getDisplayId(display.token)); in toProto()
272 proto.set_layer_stack(display.layerStack.id); in toProto()
275 proto.set_orientation(static_cast<uint32_t>(display.orientation)); in toProto()
277 proto.mutable_oriented_display_space_rect()); in toProto()
279 proto.mutable_layer_stack_space_rect()); in toProto()
282 proto.set_width(display.width); in toProto()
283 proto.set_height(display.height); in toProto()
286 proto.set_flags(display.flags); in toProto()
288 return proto; in toProto()
292 perfetto::protos::LayerCreationArgs proto; in toProto() local
293 proto.set_layer_id(args.sequence); in toProto()
294 proto.set_name(args.name); in toProto()
295 proto.set_flags(args.flags); in toProto()
296 proto.set_parent_id(args.parentId); in toProto()
297 proto.set_mirror_from_id(args.layerIdToMirror); in toProto()
298 proto.set_add_to_root(args.addToRoot); in toProto()
299 proto.set_layer_stack_to_mirror(args.layerStackToMirror.id); in toProto()
300 return proto; in toProto()
304 const perfetto::protos::TransactionState& proto) { in fromProto() argument
306 t.originPid = proto.pid(); in fromProto()
307 t.originUid = proto.uid(); in fromProto()
308 t.frameTimelineInfo.vsyncId = proto.vsync_id(); in fromProto()
309 t.frameTimelineInfo.inputEventId = proto.input_event_id(); in fromProto()
310 t.postTime = proto.post_time(); in fromProto()
311 t.id = proto.transaction_id(); in fromProto()
313 int32_t layerCount = proto.layer_changes_size(); in fromProto()
318 fromProto(proto.layer_changes(i), s); in fromProto()
322 int32_t displayCount = proto.display_changes_size(); in fromProto()
325 t.displays.add(fromProto(proto.display_changes(i))); in fromProto()
330 void TransactionProtoParser::fromProto(const perfetto::protos::LayerCreationArgs& proto, in fromProto() argument
332 outArgs.sequence = proto.layer_id(); in fromProto()
334 outArgs.name = proto.name(); in fromProto()
335 outArgs.flags = proto.flags(); in fromProto()
336 outArgs.parentId = proto.parent_id(); in fromProto()
337 outArgs.layerIdToMirror = proto.mirror_from_id(); in fromProto()
338 outArgs.addToRoot = proto.add_to_root(); in fromProto()
339 outArgs.layerStackToMirror.id = proto.layer_stack_to_mirror(); in fromProto()
342 void TransactionProtoParser::mergeFromProto(const perfetto::protos::LayerState& proto, in mergeFromProto() argument
345 fromProto(proto, resolvedComposerState); in mergeFromProto()
363 outState.hasSidebandStream = proto.has_sideband_stream(); in mergeFromProto()
367 void TransactionProtoParser::fromProto(const perfetto::protos::LayerState& proto, in fromProto() argument
370 resolvedComposerState.layerId = proto.layer_id(); in fromProto()
371 layer.what |= proto.what(); in fromProto()
373 if (proto.what() & layer_state_t::ePositionChanged) { in fromProto()
374 layer.x = proto.x(); in fromProto()
375 layer.y = proto.y(); in fromProto()
377 if (proto.what() & layer_state_t::eLayerChanged) { in fromProto()
378 layer.z = proto.z(); in fromProto()
380 if (proto.what() & layer_state_t::eLayerStackChanged) { in fromProto()
381 layer.layerStack.id = proto.layer_stack(); in fromProto()
383 if (proto.what() & layer_state_t::eFlagsChanged) { in fromProto()
384 layer.flags = proto.flags(); in fromProto()
385 layer.mask = proto.mask(); in fromProto()
387 if (proto.what() & layer_state_t::eMatrixChanged) { in fromProto()
388 const perfetto::protos::LayerState_Matrix22& matrixProto = proto.matrix(); in fromProto()
394 if (proto.what() & layer_state_t::eCornerRadiusChanged) { in fromProto()
395 layer.cornerRadius = proto.corner_radius(); in fromProto()
397 if (proto.what() & layer_state_t::eBackgroundBlurRadiusChanged) { in fromProto()
398 layer.backgroundBlurRadius = proto.background_blur_radius(); in fromProto()
401 if (proto.what() & layer_state_t::eAlphaChanged) { in fromProto()
402 layer.color.a = proto.alpha(); in fromProto()
405 if (proto.what() & layer_state_t::eColorChanged) { in fromProto()
406 const perfetto::protos::LayerState_Color3& colorProto = proto.color(); in fromProto()
411 if (proto.what() & layer_state_t::eTransparentRegionChanged) { in fromProto()
412 LayerProtoHelper::readFromProto(proto.transparent_region(), layer.transparentRegion); in fromProto()
414 if (proto.what() & layer_state_t::eBufferTransformChanged) { in fromProto()
415 layer.bufferTransform = proto.transform(); in fromProto()
417 if (proto.what() & layer_state_t::eTransformToDisplayInverseChanged) { in fromProto()
418 layer.transformToDisplayInverse = proto.transform_to_display_inverse(); in fromProto()
420 if (proto.what() & layer_state_t::eCropChanged) { in fromProto()
421 LayerProtoHelper::readFromProto(proto.crop(), layer.crop); in fromProto()
423 if (proto.what() & layer_state_t::eBufferChanged) { in fromProto()
424 const perfetto::protos::LayerState_BufferData& bufferProto = proto.buffer_data(); in fromProto()
442 if (proto.what() & layer_state_t::eApiChanged) { in fromProto()
443 layer.api = proto.api(); in fromProto()
446 if (proto.what() & layer_state_t::eColorTransformChanged) { in fromProto()
447 LayerProtoHelper::readFromProto(proto.color_transform(), layer.colorTransform); in fromProto()
449 if (proto.what() & layer_state_t::eBlurRegionsChanged) { in fromProto()
450 layer.blurRegions.reserve(static_cast<size_t>(proto.blur_regions_size())); in fromProto()
451 for (int i = 0; i < proto.blur_regions_size(); i++) { in fromProto()
453 LayerProtoHelper::readFromProto(proto.blur_regions(i), region); in fromProto()
458 if (proto.what() & layer_state_t::eReparent) { in fromProto()
459 resolvedComposerState.parentId = proto.parent_id(); in fromProto()
461 if (proto.what() & layer_state_t::eRelativeLayerChanged) { in fromProto()
462 resolvedComposerState.relativeParentId = proto.relative_parent_id(); in fromProto()
463 layer.z = proto.z(); in fromProto()
466 if ((proto.what() & layer_state_t::eInputInfoChanged) && proto.has_window_info_handle()) { in fromProto()
468 const perfetto::protos::LayerState_WindowInfo& windowInfoProto = proto.window_info_handle(); in fromProto()
490 if (proto.what() & layer_state_t::eBackgroundColorChanged) { in fromProto()
491 layer.bgColor.a = proto.bg_color_alpha(); in fromProto()
492 layer.bgColorDataspace = static_cast<ui::Dataspace>(proto.bg_color_dataspace()); in fromProto()
493 const perfetto::protos::LayerState_Color3& colorProto = proto.color(); in fromProto()
498 if (proto.what() & layer_state_t::eColorSpaceAgnosticChanged) { in fromProto()
499 layer.colorSpaceAgnostic = proto.color_space_agnostic(); in fromProto()
501 if (proto.what() & layer_state_t::eShadowRadiusChanged) { in fromProto()
502 layer.shadowRadius = proto.shadow_radius(); in fromProto()
504 if (proto.what() & layer_state_t::eFrameRateSelectionPriority) { in fromProto()
505 layer.frameRateSelectionPriority = proto.frame_rate_selection_priority(); in fromProto()
507 if (proto.what() & layer_state_t::eFrameRateChanged) { in fromProto()
508 layer.frameRate = proto.frame_rate(); in fromProto()
509 layer.frameRateCompatibility = static_cast<int8_t>(proto.frame_rate_compatibility()); in fromProto()
510 layer.changeFrameRateStrategy = static_cast<int8_t>(proto.change_frame_rate_strategy()); in fromProto()
512 if (proto.what() & layer_state_t::eFixedTransformHintChanged) { in fromProto()
514 static_cast<ui::Transform::RotationFlags>(proto.fixed_transform_hint()); in fromProto()
516 if (proto.what() & layer_state_t::eAutoRefreshChanged) { in fromProto()
517 layer.autoRefresh = proto.auto_refresh(); in fromProto()
519 if (proto.what() & layer_state_t::eTrustedOverlayChanged) { in fromProto()
520 layer.trustedOverlay = proto.is_trusted_overlay() ? gui::TrustedOverlay::ENABLED in fromProto()
523 if (proto.what() & layer_state_t::eBufferCropChanged) { in fromProto()
524 LayerProtoHelper::readFromProto(proto.buffer_crop(), layer.bufferCrop); in fromProto()
526 if (proto.what() & layer_state_t::eDestinationFrameChanged) { in fromProto()
527 LayerProtoHelper::readFromProto(proto.destination_frame(), layer.destinationFrame); in fromProto()
529 if (proto.what() & layer_state_t::eDropInputModeChanged) { in fromProto()
530 layer.dropInputMode = static_cast<gui::DropInputMode>(proto.drop_input_mode()); in fromProto()
534 DisplayState TransactionProtoParser::fromProto(const perfetto::protos::DisplayState& proto) { in fromProto() argument
536 display.what = proto.what(); in fromProto()
537 display.token = mMapper->getDisplayHandle(proto.id()); in fromProto()
540 display.layerStack.id = proto.layer_stack(); in fromProto()
543 display.orientation = static_cast<ui::Rotation>(proto.orientation()); in fromProto()
544 LayerProtoHelper::readFromProto(proto.oriented_display_space_rect(), in fromProto()
546 LayerProtoHelper::readFromProto(proto.layer_stack_space_rect(), in fromProto()
550 display.width = proto.width(); in fromProto()
551 display.height = proto.height(); in fromProto()
554 display.flags = proto.flags(); in fromProto()
559 void asProto(perfetto::protos::Transform* proto, const ui::Transform& transform) { in asProto() argument
560 proto->set_dsdx(transform.dsdx()); in asProto()
561 proto->set_dtdx(transform.dtdx()); in asProto()
562 proto->set_dtdy(transform.dtdy()); in asProto()
563 proto->set_dsdy(transform.dsdy()); in asProto()
564 proto->set_tx(transform.tx()); in asProto()
565 proto->set_ty(transform.ty()); in asProto()
570 perfetto::protos::DisplayInfo proto; in toProto() local
571 proto.set_layer_stack(layerStack); in toProto()
572 proto.set_display_id(displayInfo.info.displayId.val()); in toProto()
573 proto.set_logical_width(displayInfo.info.logicalWidth); in toProto()
574 proto.set_logical_height(displayInfo.info.logicalHeight); in toProto()
575 asProto(proto.mutable_transform_inverse(), displayInfo.info.transform); in toProto()
576 asProto(proto.mutable_transform(), displayInfo.transform); in toProto()
577 proto.set_receives_input(displayInfo.receivesInput); in toProto()
578 proto.set_is_secure(displayInfo.isSecure); in toProto()
579 proto.set_is_primary(displayInfo.isPrimary); in toProto()
580 proto.set_is_virtual(displayInfo.isVirtual); in toProto()
581 proto.set_rotation_flags((int)displayInfo.rotationFlags); in toProto()
582 proto.set_transform_hint((int)displayInfo.transformHint); in toProto()
583 return proto; in toProto()
586 void fromProto2(ui::Transform& outTransform, const perfetto::protos::Transform& proto) { in fromProto2() argument
587 outTransform.set(proto.dsdx(), proto.dtdx(), proto.dtdy(), proto.dsdy()); in fromProto2()
588 outTransform.set(proto.tx(), proto.ty()); in fromProto2()
592 const perfetto::protos::DisplayInfo& proto) { in fromProto() argument
594 displayInfo.info.displayId = ui::LogicalDisplayId{proto.display_id()}; in fromProto()
595 displayInfo.info.logicalWidth = proto.logical_width(); in fromProto()
596 displayInfo.info.logicalHeight = proto.logical_height(); in fromProto()
597 fromProto2(displayInfo.info.transform, proto.transform_inverse()); in fromProto()
598 fromProto2(displayInfo.transform, proto.transform()); in fromProto()
599 displayInfo.receivesInput = proto.receives_input(); in fromProto()
600 displayInfo.isSecure = proto.is_secure(); in fromProto()
601 displayInfo.isPrimary = proto.is_primary(); in fromProto()
602 displayInfo.isVirtual = proto.is_virtual(); in fromProto()
603 displayInfo.rotationFlags = (ui::Transform::RotationFlags)proto.rotation_flags(); in fromProto()
604 displayInfo.transformHint = (ui::Transform::RotationFlags)proto.transform_hint(); in fromProto()
609 const google::protobuf::RepeatedPtrField<perfetto::protos::DisplayInfo>& proto, in fromProto() argument
612 for (const perfetto::protos::DisplayInfo& displayInfo : proto) { in fromProto()