Commit ba3b6797 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

RenderPass <=> DictionaryValue

This CL import/export RenderPass data from/to DictionaryValue.

Most fields are iterated through, so they are readable/modifiable in
the JSON file. However, filters are saved as a encoded string. It
will be implemented in the future if needs arise.

The issue not to iterate through filters data is that whenever we
update the data structure, it invalidates previously recorded data.

A followup CL will add recorded render pass list JSON files from
top sites, and use them for renderer_perftests.

R=sunnyps@chromium.org

Change-Id: Ieff731ca5558bc5647ff1d8d1f0e06d103dbaab0
Bug: 1026447
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1889114
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723654}
parent 5705b469
......@@ -36,9 +36,9 @@ viz_component("resource_format_utils") {
"//cc/base:base",
"//gpu/vulkan:buildflags",
"//skia",
"//third_party/dawn/src/dawn:dawncpp_headers",
"//ui/gfx:buffer_types",
"//ui/gfx/geometry:geometry",
"//third_party/dawn/src/dawn:dawncpp_headers",
]
}
......@@ -210,6 +210,8 @@ viz_component("common") {
"quads/render_pass.h",
"quads/render_pass_draw_quad.cc",
"quads/render_pass_draw_quad.h",
"quads/render_pass_io.cc",
"quads/render_pass_io.h",
"quads/selection.h",
"quads/shared_quad_state.cc",
"quads/shared_quad_state.h",
......@@ -355,6 +357,7 @@ viz_source_set("unit_tests") {
"gl_scaler_unittest.cc",
"gpu/context_cache_controller_unittest.cc",
"quads/draw_quad_unittest.cc",
"quads/render_pass_io_unittest.cc",
"quads/render_pass_unittest.cc",
"resources/resource_sizes_unittest.cc",
"surfaces/child_local_surface_id_allocator_unittest.cc",
......
This diff is collapsed.
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_COMMON_QUADS_RENDER_PASS_IO_H_
#define COMPONENTS_VIZ_COMMON_QUADS_RENDER_PASS_IO_H_
#include <memory>
#include "base/values.h"
#include "components/viz/common/quads/render_pass.h"
#include "components/viz/common/viz_common_export.h"
namespace viz {
namespace internal {
// These functions are declared publicly so they could have friend access to
// private fields of gfx::ColorSpace for the purpose of serialization and
// deserialization. They should not be used outside render_pass_io.cc.
base::Value ColorSpaceToDict(const gfx::ColorSpace& color_space);
bool ColorSpaceFromDict(const base::Value& dict, gfx::ColorSpace* color_space);
} // namespace internal
VIZ_COMMON_EXPORT base::Value RenderPassToDict(const RenderPass& render_pass);
VIZ_COMMON_EXPORT std::unique_ptr<RenderPass> RenderPassFromDict(
const base::Value& dict);
VIZ_COMMON_EXPORT base::Value RenderPassListToDict(
const RenderPassList& render_pass_list);
VIZ_COMMON_EXPORT bool RenderPassListFromDict(const base::Value& dict,
RenderPassList* render_pass_list);
} // namespace viz
#endif // COMPONENTS_VIZ_COMMON_QUADS_RENDER_PASS_IO_H_
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment