• Jonathan Backer's avatar
    Enable GPU debug flags for unittests · 7bc44599
    Jonathan Backer authored
    This refactor CL allows useful GPU service flags like
    --enable-gpu-service-logging (log all GL commands processed) and
    --enable-gpu-debugging (check for GL error after every command) to be
    used when running unittests (e.g. cc_unittests) that use
    InProcessCommandBuffer.
    
    There are no security implications of this change because
    
    - only tests use the codepath updated here (Viz and android webview do
      not)
    
    - flags are whitelist passed to child processes (renderer/GPU processes)
    
    ParseGpuPreferences could not easily be added as a member of
    GpuPreferences because of dependencies.
    
      - ParseGpuPreferences depends on gpu/command_buffer/service:gles2 to
        check if passthrough decoder is enabled.
    
      - gpu/command_buffer/service:gles2 has a dependency on
        gpu/command_buffer/service:service
    
      - GpuPreferences lives in gpu/command_buffer/service:service
    
      - Moving GpuPreferences to gpu/command_buffer/service:gles2 seems
        non-trivial. I did not want to introduce a new component just for
        GpuPreferences.
    
    ParseGpuPreferences did not seem to belong to gpu_preferences_util.h
    because that is IPC specific.
    
    Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
    Change-Id: I76db4fe0eebd3eb7720fa24265f69093715c6137
    Reviewed-on: https://chromium-review.googlesource.com/1019662Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Commit-Queue: Jonathan Backer <backer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#553707}
    7bc44599
gpu_utils.cc 4 KB