class PaperShapeCache
Defined at line 40 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
Generates and caches clipped triangle meshes that match the requested shape
specification.
Public Members
static const size_t kNumFramesBeforeEviction
Public Methods
MeshSpec kStandardMeshSpec ()
The generated/cached meshes don't interleave attributes; they are stored in separate vertex
buffers (or at least in disjoint regions of a vertex buffer).
Defined at line 46 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
MeshSpec kShadowVolumeMeshSpec ()
Defined at line 47 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
const PaperShapeCacheEntry & GetRectMesh (float width, float height, const plane3 * clip_planes, size_t num_clip_planes)
Defined at line 71 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
uint64_t frame_number ()
Defined at line 83 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
size_t size ()
Defined at line 87 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
uint64_t cache_hit_count ()
Defined at line 89 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
uint64_t cache_hit_after_plane_culling_count ()
Defined at line 90 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
uint64_t cache_miss_count ()
Defined at line 93 of file ../../src/ui/lib/escher/paper/paper_shape_cache.h
void PaperShapeCache (EscherWeakPtr escher, const PaperRendererConfig & config)
TODO(https://fxbug.dev/42121362): use constexpr instead, when vulkan.hpp is new enough.
static constexpr MeshSpec kStandardMeshSpec{{MeshAttribute::kPosition2D, MeshAttribute::kUV}};
static constexpr MeshSpec kShadowVolumeMeshSpec{
{MeshAttribute::kPosition2D, MeshAttribute::kUV, MeshAttribute::kBlendWeight1}};
Defined at line 195 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
void ~PaperShapeCache ()
Defined at line 198 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
const PaperShapeCacheEntry & GetRoundedRectMesh (const RoundedRectSpec & spec, const plane3 * clip_planes, size_t num_clip_planes)
Return a (possibly cached) mesh that matches the shape parameters. To
look up the mesh, a hash is computed from the shape parameters along with
the list of clip planes. If the mesh is not found, a new mesh is generated
from the shape parameters, clipped by the list of planes, and
post-processed in whatever way is required by the current |PaperRenderer|
configuration (e.g. perhaps adding a vertex attribute to allow
shadow-volume extrusion in the vertex shader).
Defined at line 240 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
const PaperShapeCacheEntry & GetCircleMesh (float radius, const plane3 * clip_planes, size_t num_clip_planes)
Defined at line 286 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
const PaperShapeCacheEntry & GetRectMesh (vec2 min, vec2 max, const plane3 * clip_planes, size_t num_clip_planes)
Defined at line 319 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
const PaperShapeCacheEntry & GetBoxMesh (const plane3 * clip_planes, size_t num_clip_planes)
Used for wireframe debugging.
Defined at line 359 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
void BeginFrame (BatchGpuUploader * uploader, uint64_t frame_number)
Defined at line 200 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
void EndFrame ()
Defined at line 212 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc
void SetConfig (const PaperRendererConfig & config)
Defined at line 227 of file ../../src/ui/lib/escher/paper/paper_shape_cache.cc