Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1358)

Unified Diff: ui/gl/gl_image_io_surface.mm

Issue 1299713003: GLImage::OnMemoryDump Stubs + Some Impls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@images1.3
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698