MCPcopy Create free account
hub / github.com/GNOME/gjs / remove_associated_memory_for_surface

Function remove_associated_memory_for_surface

modules/cairo-memory.cpp:71–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void remove_associated_memory_for_surface(JSObject* obj,
72 cairo_surface_t* surface) {
73 switch (cairo_surface_get_type(surface)) {
74#ifdef CAIRO_HAS_IMAGE_SURFACE
75 case CAIRO_SURFACE_TYPE_IMAGE: {
76 int32_t estimated_size = estimate_size_of_image_surface(surface);
77 JS::RemoveAssociatedMemory(obj, estimated_size, MemoryUse::Cairo);
78 break;
79 }
80#endif
81#ifdef CAIRO_HAS_XLIB_SURFACE
82 case CAIRO_SURFACE_TYPE_XLIB: {
83 int32_t estimated_size = estimate_size_of_xlib_surface(surface);
84 JS::RemoveAssociatedMemory(obj, estimated_size, MemoryUse::Cairo);
85 break;
86 }
87#endif
88 // Other backends not handled yet
89 default:
90 break;
91 }
92}
93
94void add_associated_memory_for_pattern(JSObject* obj,
95 cairo_pattern_t* pattern) {

Tested by

no test coverage detected