// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module viz.mojom;
import "services/viz/public/mojom/compositing/compositor_render_pass_id.mojom";
import "services/viz/public/mojom/compositing/copy_output_request.mojom";
import "services/viz/public/mojom/compositing/filter_operations.mojom";
import "services/viz/public/mojom/compositing/quads.mojom";
import "services/viz/public/mojom/compositing/view_transition_element_resource_id.mojom";
import "services/viz/public/mojom/compositing/subtree_capture_id.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/mojom/rrect_f.mojom";
import "ui/gfx/mojom/transform.mojom";
// See components/viz/common/quads/compositor_render_pass.h.
struct CompositorRenderPass {
CompositorRenderPassId id;
gfx.mojom.Rect output_rect;
gfx.mojom.Rect damage_rect;
gfx.mojom.Transform transform_to_root_target;
FilterOperations filters;
FilterOperations backdrop_filters;
gfx.mojom.RRectF? backdrop_filter_bounds;
SubtreeCaptureId subtree_capture_id;
gfx.mojom.Size subtree_size;
ViewTransitionElementResourceId? view_transition_element_resource_id;
bool has_transparent_background;
bool cache_render_pass = false;
bool has_damage_from_contributing_content = false;
bool generate_mipmap = false;
// |copy_requests| are only allowed by privileged clients.
array<CopyOutputRequest> copy_requests;
array<DrawQuad> quad_list;
// |has_per_quad_damage| is primarily used as a performance hint to surface
// aggregator. Maliciously setting to true means some extra work looping
// over the quads looking for a |per_quad_damage| rect where none exists.
// Maliciously setting this to false will result in skipping damage found in
// |quad_list|. This missing damage may lead to incorrect repaint but only
// for this specific |CompositorRenderPass|. Neither one of these malicious
// inconsistent states give new privileges to the sender that were not already
// available with |damage_rect| or |quad_list|.
bool has_per_quad_damage;
};