// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40285824): Remove this and convert code to safer constructs. #pragma allow_unsafe_buffers #endif #ifndef COMPONENTS_VIZ_COMMON_QUADS_DRAW_QUAD_H_ #define COMPONENTS_VIZ_COMMON_QUADS_DRAW_QUAD_H_ #include <stddef.h> #include "base/functional/callback.h" #include "base/memory/raw_ptr_exclusion.h" #include "components/viz/common/quads/shared_quad_state.h" #include "components/viz/common/resources/resource_id.h" #include "components/viz/common/viz_common_export.h" namespace base { namespace trace_event { class TracedValue; } } // namespace base namespace viz { // DrawQuad is a bag of data used for drawing a quad. Because different // materials need different bits of per-quad data to render, classes that derive // from DrawQuad store additional data in their derived instance. The Material // enum is used to "safely" downcast to the derived class. // Note: quads contain rects and sizes, which live in different spaces. There is // the "content space", which is the arbitrary space in which the quad's // geometry is defined (generally related to the layer that produced the quad, // e.g. the geometry space for PictureLayerImpls or the layer's coordinate space // for most other layers). There is also the "target space", which is the space, // in "physical" pixels, of the render target where the quads is drawn. The // quad's transform maps the content space to the target space. class VIZ_COMMON_EXPORT DrawQuad { … }; } // namespace viz #endif // COMPONENTS_VIZ_COMMON_QUADS_DRAW_QUAD_H_