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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1992253002: Adding performance tracking for canvas API calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 5c8f2329b9f16f6332811ff126ce444d048ada06..e907301636b8fda1f9195eb31104c113416dbe63 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -604,6 +604,18 @@ String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double
String HTMLCanvasElement::toDataURL(const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState) const
{
+ Optional<ScopedUsHistogramTimer> timer;
+ if (m_imageBuffer && m_imageBuffer->isAccelerated()) {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounterGPU, ("Blink.Canvas.ToDataURL.GPU", 0, 10000000, 50));
Justin Novosad 2016/05/19 15:28:40 You are missing entries in histograms.xml
+ timer.emplace(scopedUsCounterGPU);
+ } else if (m_imageBuffer && m_imageBuffer->isRecording()) {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounterDL, ("Blink.Canvas.ToDataURL.DL", 0, 10000000, 50));
Justin Novosad 2016/05/19 15:28:39 DL -> DisplayList
xidachen 2016/05/20 12:36:54 Changed in all places.
+ timer.emplace(scopedUsCounterDL);
+ } else {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounterSW, ("Blink.Canvas.ToDataURL.SW", 0, 10000000, 50));
Justin Novosad 2016/05/19 15:28:40 SW -> CPU
xidachen 2016/05/20 12:36:54 Changed in all places.
+ timer.emplace(scopedUsCounterSW);
+ }
+
if (!originClean()) {
exceptionState.throwSecurityError("Tainted canvases may not be exported.");
Justin Novosad 2016/05/19 15:36:55 We should start the measurement after this early e
xidachen 2016/05/20 12:36:54 Done.
return String();

Powered by Google App Engine
This is Rietveld 408576698