From b911ca8694e6d127016dea03e537468f2bef0253 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Fri, 24 Feb 2012 03:03:52 +0000 Subject: [PATCH] [Chromium] Add profiling trace for deferred canvas rendering https://bugs.webkit.org/show_bug.cgi?id=79376 Patch by Justin Novosad on 2012-02-23 Reviewed by Stephen White. No new tests. * platform/graphics/chromium/Canvas2DLayerChromium.cpp: (WebCore::Canvas2DLayerChromium::paintContentsIfDirty): Profiling trace for the entire method, as well as for calls to canvas flush and context flush, both of which may cause deferred operation to be executed. * platform/graphics/skia/PlatformContextSkia.cpp: (WebCore::PlatformContextSkia::bitmap): Inserting a profiling trace in this method because it may cause deferred draw commands to be executed. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108714 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 19 +++++++++++++++++++ .../graphics/chromium/Canvas2DLayerChromium.cpp | 6 +++++- .../platform/graphics/skia/PlatformContextSkia.cpp | 7 +++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 98c6512..ce5bc0e 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2012-02-23 Justin Novosad + + [Chromium] Add profiling trace for deferred canvas rendering + https://bugs.webkit.org/show_bug.cgi?id=79376 + + Reviewed by Stephen White. + + No new tests. + + * platform/graphics/chromium/Canvas2DLayerChromium.cpp: + (WebCore::Canvas2DLayerChromium::paintContentsIfDirty): + Profiling trace for the entire method, as well as for + calls to canvas flush and context flush, both of which may + cause deferred operation to be executed. + * platform/graphics/skia/PlatformContextSkia.cpp: + (WebCore::PlatformContextSkia::bitmap): + Inserting a profiling trace in this method because it may cause + deferred draw commands to be executed. + 2012-02-23 Shinya Kawanaka ShadowRootList should have recalculation flag instead of ShadowRoot. diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp index 14fe35a..d8b4bbe 100644 --- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp @@ -97,6 +97,7 @@ void Canvas2DLayerChromium::setCanvas(SkCanvas* canvas) void Canvas2DLayerChromium::paintContentsIfDirty(const Region& /* occludedScreenSpace */) { + TRACE_EVENT("Canvas2DLayerChromium::paintContentsIfDirty", this, 0); if (!drawsContent()) return; @@ -111,9 +112,12 @@ void Canvas2DLayerChromium::paintContentsIfDirty(const Region& /* occludedScreen bool success = m_context->makeContextCurrent(); ASSERT_UNUSED(success, success); - if (m_canvas) + if (m_canvas) { + TRACE_EVENT("SkDeferredCanvas::flush", m_canvas, 0); m_canvas->flush(); + } + TRACE_EVENT("GrContext::flush", m_context, 0); m_context->flush(); } diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index c323a0d..3a677e2 100644 --- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -52,6 +52,10 @@ #include #include +#if PLATFORM(CHROMIUM) +#include "TraceEvent.h" +#endif + namespace WebCore { // State ----------------------------------------------------------------------- @@ -551,6 +555,9 @@ void PlatformContextSkia::paintSkPaint(const SkRect& rect, const SkBitmap* PlatformContextSkia::bitmap() const { +#if PLATFORM(CHROMIUM) + TRACE_EVENT("PlatformContextSkia::bitmap", this, 0); +#endif return &m_canvas->getDevice()->accessBitmap(false); } -- 2.7.4