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

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp

Issue 2400223002: Add UMA metrics to OffscreenCanvas's commit type (Closed)
Patch Set: remove an unnecessary include line Created 4 years, 2 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: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index 32204cf95bc0171c5e8dd8cb31b6f30b823703c3..d1a6788683b9f14cc147e7f022fe7d9661fd5c23 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -12,9 +12,8 @@
#include "cc/quads/texture_draw_quad.h"
#include "cc/resources/returned_resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
-#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/Histogram.h"
#include "platform/graphics/gpu/SharedGpuContext.h"
-#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/InterfaceProvider.h"
#include "public/platform/Platform.h"
#include "public/platform/WebGraphicsContext3DProvider.h"
@@ -188,18 +187,27 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
// TODO(crbug.com/646022): making this overlay-able.
resource.is_overlay_candidate = false;
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(
+ EnumerationHistogram, commitTypeHistogram,
+ new EnumerationHistogram("OffscreenCanvas.CommitType",
+ OffscreenCanvasCommitTypeCount));
if (!image->isTextureBacked() &&
- !Platform::current()->isGPUCompositingEnabled())
+ !Platform::current()->isGPUCompositingEnabled()) {
+ commitTypeHistogram.count(CommitSoftwareCanvasSoftwareCompositing);
setTransferableResourceInMemory(resource, image);
- else if (!image->isTextureBacked() &&
- Platform::current()->isGPUCompositingEnabled())
+ } else if (!image->isTextureBacked() &&
+ Platform::current()->isGPUCompositingEnabled()) {
+ commitTypeHistogram.count(CommitSoftwareCanvasGPUCompositing);
setTransferableResourceMemoryToTexture(resource, image);
- else if (image->isTextureBacked() &&
- (!Platform::current()->isGPUCompositingEnabled() ||
- isWebGLSoftwareRendering))
+ } else if (image->isTextureBacked() &&
+ (!Platform::current()->isGPUCompositingEnabled() ||
+ isWebGLSoftwareRendering)) {
+ commitTypeHistogram.count(CommitGPUCanvasSoftwareCompositing);
setTransferableResourceInMemory(resource, image);
- else
+ } else {
+ commitTypeHistogram.count(CommitGPUCanvasGPUCompositing);
setTransferableResourceInTexture(resource, image);
+ }
m_nextResourceId++;
frame.delegated_frame_data->resource_list.push_back(std::move(resource));

Powered by Google App Engine
This is Rietveld 408576698