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

Side by Side Diff: ui/gl/gl_image_io_surface.mm

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: Implement buckets Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_image_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 base::trace_event::MemoryAllocatorDump* dump = 361 base::trace_event::MemoryAllocatorDump* dump =
362 pmd->CreateAllocatorDump(dump_name); 362 pmd->CreateAllocatorDump(dump_name);
363 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, 363 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
364 base::trace_event::MemoryAllocatorDump::kUnitsBytes, 364 base::trace_event::MemoryAllocatorDump::kUnitsBytes,
365 static_cast<uint64_t>(size_bytes)); 365 static_cast<uint64_t>(size_bytes));
366 366
367 auto guid = 367 auto guid =
368 GetGenericSharedMemoryGUIDForTracing(process_tracing_id, io_surface_id_); 368 GetGenericSharedMemoryGUIDForTracing(process_tracing_id, io_surface_id_);
369 pmd->CreateSharedGlobalAllocatorDump(guid); 369 pmd->CreateSharedGlobalAllocatorDump(guid);
370 pmd->AddOwnershipEdge(dump->guid(), guid); 370 pmd->AddOwnershipEdge(dump->guid(), guid);
371 // TODO(hajimehoshi): Call
372 // base::SharedMemoryDumpProvider::AddOwnershipEdgeToSharedGlobalDump to
373 // report shared memory usage correctly.
371 } 374 }
372 375
373 bool GLImageIOSurface::EmulatingRGB() const { 376 bool GLImageIOSurface::EmulatingRGB() const {
374 return client_internalformat_ == GL_RGB; 377 return client_internalformat_ == GL_RGB;
375 } 378 }
376 379
377 bool GLImageIOSurface::CanCheckIOSurfaceIsInUse() const { 380 bool GLImageIOSurface::CanCheckIOSurfaceIsInUse() const {
378 return !cv_pixel_buffer_; 381 return !cv_pixel_buffer_;
379 } 382 }
380 383
(...skipping 17 matching lines...) Expand all
398 } 401 }
399 402
400 // static 403 // static
401 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { 404 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) {
402 if (!image || image->GetType() != Type::IOSURFACE) 405 if (!image || image->GetType() != Type::IOSURFACE)
403 return nullptr; 406 return nullptr;
404 return static_cast<GLImageIOSurface*>(image); 407 return static_cast<GLImageIOSurface*>(image);
405 } 408 }
406 409
407 } // namespace gl 410 } // namespace gl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698