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

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

Issue 1609343004: Add display list fallback reason histograms for 2D canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl web Created 4 years, 10 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/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index a9c898469e5fd847cdd14895c6d4f72aee46e878..8a19735c891aa8d43d6180556aa1e0ecf200bb50 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -331,7 +331,7 @@ SkCanvas* Canvas2DLayerBridge::canvas()
return m_recorder->getRecordingCanvas();
}
-void Canvas2DLayerBridge::disableDeferral()
+void Canvas2DLayerBridge::disableDeferral(DisableDeferralReason reason)
{
// Disabling deferral is permanent: once triggered by disableDeferral()
// we stay in immediate mode indefinitely. This is a performance heuristic
@@ -345,6 +345,7 @@ void Canvas2DLayerBridge::disableDeferral()
if (!m_isDeferralEnabled)
return;
+ Platform::current()->histogramEnumeration("Canvas.GPUAccelerated2DCanvasDisableDeferralReason", reason, DisableDeferralReasonCount);
CanvasMetrics::countCanvasContextUsage(CanvasMetrics::GPUAccelerated2DCanvasDeferralDisabled);
flushRecordingOnly();
// Because we will be discarding the recorder, if the flush failed
@@ -601,7 +602,7 @@ bool Canvas2DLayerBridge::prepareMailbox(WebExternalTextureMailbox* outMailbox,
return false;
}
- RefPtr<SkImage> image = newImageSnapshot(PreferAcceleration);
+ RefPtr<SkImage> image = newImageSnapshot(PreferAcceleration, SnapshotReasonUnknown);
if (!image || !image->getTexture())
return false;
@@ -738,7 +739,7 @@ void Canvas2DLayerBridge::didDraw(const FloatRect& rect)
IntRect pixelBounds = enclosingIntRect(rect);
m_recordingPixelCount += pixelBounds.width() * pixelBounds.height();
if (m_recordingPixelCount >= (m_size.width() * m_size.height() * ExpensiveCanvasHeuristicParameters::ExpensiveOverdrawThreshold)) {
- disableDeferral();
+ disableDeferral(DisableDeferralReasonExpensiveOverdrawHeuristic);
}
}
if (!m_isRegisteredTaskObserver) {
@@ -794,7 +795,7 @@ void Canvas2DLayerBridge::willProcessTask()
ASSERT_NOT_REACHED();
}
-PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot(AccelerationHint hint)
+PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot(AccelerationHint hint, SnapshotReason)
{
if (!checkSurfaceValid())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698