| Index: ui/gl/gl_image_io_surface.mm
|
| diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
|
| index 3b8edcb13d79d7708bf1e4b5cbcbbbac53d617a7..24ec2716506705e4fea56b0565c63a1ec013271f 100644
|
| --- a/ui/gl/gl_image_io_surface.mm
|
| +++ b/ui/gl/gl_image_io_surface.mm
|
| @@ -127,9 +127,11 @@ GLenum DataType(BufferFormat format) {
|
|
|
| } // namespace
|
|
|
| -GLImageIOSurface::GLImageIOSurface(const gfx::Size& size,
|
| +GLImageIOSurface::GLImageIOSurface(gfx::GenericSharedMemoryId io_surface_id,
|
| + const gfx::Size& size,
|
| unsigned internalformat)
|
| - : size_(size),
|
| + : io_surface_id_(io_surface_id),
|
| + size_(size),
|
| internalformat_(internalformat),
|
| format_(BufferFormat::RGBA_8888) {}
|
|
|
| @@ -211,6 +213,23 @@ base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() {
|
| return io_surface_;
|
| }
|
|
|
| +void GLImageIOSurface::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
|
| + uint64_t process_tracing_id,
|
| + const std::string& dump_name) {
|
| + size_t size_bytes = IOSurfaceGetAllocSize(io_surface_);
|
| +
|
| + base::trace_event::MemoryAllocatorDump* dump =
|
| + pmd->CreateAllocatorDump(dump_name);
|
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes,
|
| + static_cast<uint64_t>(size_bytes));
|
| +
|
| + auto guid = gfx::GetGenericSharedMemoryGUIDForTracing(process_tracing_id,
|
| + io_surface_id_);
|
| + pmd->CreateSharedGlobalAllocatorDump(guid);
|
| + pmd->AddOwnershipEdge(dump->guid(), guid);
|
| +}
|
| +
|
| // static
|
| void GLImageIOSurface::SetLayerForWidget(
|
| gfx::AcceleratedWidget widget, CALayer* layer) {
|
|
|