From: commit-queue@webkit.org Date: Fri, 24 Feb 2012 03:03:52 +0000 (+0000) Subject: [Chromium] Add profiling trace for deferred canvas rendering X-Git-Tag: 070512121124~11966 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b911ca8694e6d127016dea03e537468f2bef0253;p=profile%2Fivi%2Fwebkit-efl.git [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 --- 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); }