RawDraw: add UMA Gpu.Rasterization.Raster.MSAASampleCountLog2
Bug: 1301316
Change-Id: Ieb4db00b0e8213c6c455cae778490913b844f528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3492337
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#975918}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index 0d090d4..931db23 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "base/bits.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
@@ -370,7 +371,14 @@
gpu::raster::MsaaMode msaa_mode = playback_settings.msaa_sample_count > 0
? gpu::raster::kMSAA
: gpu::raster::kNoMSAA;
-
+ // msaa_sample_count should be 1, 2, 4, 8, 16, 32, 64,
+ // and log2(msaa_sample_count) should be [0,6].
+ // If playback_settings.msaa_sample_count <= 0, the MSAA is not used. It is
+ // equivalent to MSAA sample count 1.
+ uint32_t sample_count =
+ std::clamp(playback_settings.msaa_sample_count, 1, 64);
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Gpu.Rasterization.Raster.MSAASampleCountLog2",
+ base::bits::Log2Floor(sample_count), 0, 7, 7);
// With Raw Draw, the framebuffer will be the rasterization target. It cannot
// support LCD text, so disable LCD text for Raw Draw backings.
// TODO(penghuang): remove it when GrSlug can be serialized.