gdi_debug_util_win.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_
  5. #define BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_
  6. #include <windows.h>
  7. #include "base/base_export.h"
  8. namespace base {
  9. namespace debug {
  10. struct BASE_EXPORT GdiHandleCounts {
  11. int dcs = 0;
  12. int regions = 0;
  13. int bitmaps = 0;
  14. int palettes = 0;
  15. int fonts = 0;
  16. int brushes = 0;
  17. int pens = 0;
  18. int unknown = 0;
  19. int total_tracked = 0;
  20. };
  21. // Crashes the process, using base::debug::Alias to leave valuable debugging
  22. // information in the crash dump. Pass values for |header| and |shared_section|
  23. // in the event of a bitmap allocation failure, to gather information about
  24. // those as well.
  25. BASE_EXPORT void CollectGDIUsageAndDie(BITMAPINFOHEADER* header = nullptr,
  26. HANDLE shared_section = nullptr);
  27. BASE_EXPORT GdiHandleCounts GetGDIHandleCountsInCurrentProcessForTesting();
  28. } // namespace debug
  29. } // namespace base
  30. #endif // BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_