Chromium Code Reviews| 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(); |