New issue
Advanced search Search tips

Issue 921635 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add EnumTraits for BeginFrameArgsType

Project Member Reported by kylec...@chromium.org, Jan 14

Issue description

There is a TODO at [1] to add an EnumTraits for BeginFrameArgs type. Add an EnumTraits<viz::BeginFrameArgs::BeginFrameArgsType, viz::mojom::BeginFrameArgsType> to handle the automatic conversion between the two enums and remove the static_casts.

The mojo type mapping system is explained in [2]. You might also want to look at some existing examples of EnumTraits like [3].

[1] https://cs.chromium.org/chromium/src/services/viz/public/cpp/compositing/begin_frame_args_struct_traits.cc?l=22&rcl=904348e9fd097685b80273f1149c17035533eac4
[2] https://chromium.googlesource.com/chromium/src/+/master/mojo/public/cpp/bindings/README.md#Type-Mapping
[3] https://cs.chromium.org/chromium/src/services/viz/public/cpp/compositing/copy_output_result_struct_traits.cc?l=43&rcl=b0041cfd59313062e36ca8cb7334325abd8507a2
 
Owner: celineo@google.com
Status: Started (was: Assigned)
You can also remove the BEGIN_FRAME_ARGS_TYPE_MAX value when you do this as it's not being used.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 16 (6 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3db041fa3625c6f94c44fa32da315ffee1e83c7

commit a3db041fa3625c6f94c44fa32da315ffee1e83c7
Author: Céline O'Neil <celineo@google.com>
Date: Wed Jan 16 22:31:09 2019

Refactor viz::BeginFrameArgs::BeginFrameArgsType

 * Refactor out static_cast in mojo StructTraits by defining EnumTraits
   for BeginFrameArgsType

 * Remove unused constant BEGIN_FRAME_ARGS_TYPE_MAX from BeginFrameArgsType
   enum

R=kylechar

Bug:  921635 
Change-Id: I0dbc1564c7460388ed62342216193d07ffae9493
Reviewed-on: https://chromium-review.googlesource.com/c/1412622
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Ria Jiang <riajiang@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Céline O'Neil <celineo@google.com>
Cr-Commit-Position: refs/heads/master@{#623408}
[modify] https://crrev.com/a3db041fa3625c6f94c44fa32da315ffee1e83c7/components/viz/common/frame_sinks/begin_frame_args.cc
[modify] https://crrev.com/a3db041fa3625c6f94c44fa32da315ffee1e83c7/components/viz/common/frame_sinks/begin_frame_args.h
[modify] https://crrev.com/a3db041fa3625c6f94c44fa32da315ffee1e83c7/services/viz/public/cpp/compositing/begin_frame_args_struct_traits.cc
[modify] https://crrev.com/a3db041fa3625c6f94c44fa32da315ffee1e83c7/services/viz/public/cpp/compositing/begin_frame_args_struct_traits.h
[modify] https://crrev.com/a3db041fa3625c6f94c44fa32da315ffee1e83c7/services/viz/public/interfaces/compositing/begin_frame_args.mojom

Comment 5 by celineo@google.com, Jan 17 (5 days ago)

Status: Fixed (was: Started)

Sign in to add a comment