2011-03-24 Nat Duca <nduca@chromium.org>

        Reviewed by Kenneth Russell.

        [chromium] Add traceEvents to compositor
        https://bugs.webkit.org/show_bug.cgi?id=56965

        * WebCore.gypi:
        * platform/chromium/TraceEvent.h: Added.
        (WebCore::internal::ScopeTracer::ScopeTracer):
        (WebCore::internal::ScopeTracer::~ScopeTracer):
        * platform/graphics/chromium/LayerRendererChromium.cpp:
        (WebCore::LayerRendererChromium::updateRootLayerContents):
        (WebCore::LayerRendererChromium::updateRootLayerScrollbars):
        (WebCore::LayerRendererChromium::updateLayers):
        (WebCore::LayerRendererChromium::drawLayers):
        (WebCore::LayerRendererChromium::finish):
        (WebCore::LayerRendererChromium::present):
        * platform/graphics/chromium/LayerTilerChromium.cpp:
        (WebCore::LayerTilerChromium::update):
2011-03-24  Nat Duca  <nduca@chromium.org>

        Reviewed by Kenneth Russell.

        [chromium] Add traceEvents to compositor
        https://bugs.webkit.org/show_bug.cgi?id=56965

        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::composite):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ecd2b7aa
2011-03-24 Nat Duca <nduca@chromium.org>
Reviewed by Kenneth Russell.
[chromium] Add traceEvents to compositor
https://bugs.webkit.org/show_bug.cgi?id=56965
* WebCore.gypi:
* platform/chromium/TraceEvent.h: Added.
(WebCore::internal::ScopeTracer::ScopeTracer):
(WebCore::internal::ScopeTracer::~ScopeTracer):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::updateRootLayerContents):
(WebCore::LayerRendererChromium::updateRootLayerScrollbars):
(WebCore::LayerRendererChromium::updateLayers):
(WebCore::LayerRendererChromium::drawLayers):
(WebCore::LayerRendererChromium::finish):
(WebCore::LayerRendererChromium::present):
* platform/graphics/chromium/LayerTilerChromium.cpp:
(WebCore::LayerTilerChromium::update):
2011-03-24 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Yury Semikhatsky.
......@@ -3739,6 +3739,7 @@
'platform/chromium/TemporaryLinkStubs.cpp',
'platform/chromium/ThemeChromiumMac.h',
'platform/chromium/ThemeChromiumMac.mm',
'platform/chromium/TraceEvent.h',
'platform/chromium/WidgetChromium.cpp',
'platform/chromium/WritableDataObject.cpp',
'platform/chromium/WritableDataObject.h',
......
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TraceEvent_h
#define TraceEvent_h
#include "PlatformBridge.h"
// Implementation detail: trace event macros create temporary variables
// to keep instrumentation overhead low. These macros give each temporary
// variable a unique name based on the line number to prevent name collissions.
#define TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER3(a, b) a##b
#define TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER2(a, b) TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER3(a, b)
#define TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER(name_prefix) TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER2(name_prefix, __LINE__)
// Issues PlatformBridge::traceEventBegin and traceEventEnd calls for the enclosing scope
#define TRACE_EVENT(name, id, extra) WebCore::internal::ScopeTracer TRACE_EVENT_MAKE_UNIQUE_IDENTIFIER(__traceEventScope)(name, id, extra);
namespace WebCore {
namespace internal {
// Used by TRACE_EVENT macro. Do not use directly.
class ScopeTracer {
public:
ScopeTracer(const char* name, void*, const char* extra);
~ScopeTracer();
private:
const char* m_name;
void* m_id;
OwnPtr<char*> m_extra;
};
inline ScopeTracer::ScopeTracer(const char* name, void* id, const char* extra)
: m_name(name)
, m_id(id)
{
PlatformBridge::traceEventBegin(name, id, extra); \
if (extra)
m_extra = adoptPtr(strdup(extra));
}
inline ScopeTracer::~ScopeTracer()
{
PlatformBridge::traceEventEnd(m_name, m_id, m_extra.get());
}
} // namespace internal
} // namespace WebCore
#endif
......@@ -44,6 +44,7 @@
#include "NotImplemented.h"
#include "TextStream.h"
#include "TextureManager.h"
#include "TraceEvent.h"
#include "WebGLLayerChromium.h"
#include "cc/CCLayerImpl.h"
#if USE(SKIA)
......@@ -187,11 +188,13 @@ void LayerRendererChromium::invalidateRootLayerRect(const IntRect& dirtyRect)
void LayerRendererChromium::updateRootLayerContents()
{
TRACE_EVENT("LayerRendererChromium::updateRootLayerContents", this, 0);
m_rootLayerContentTiler->update(*m_rootLayerContentPaint, m_viewportVisibleRect);
}
void LayerRendererChromium::updateRootLayerScrollbars()
{
TRACE_EVENT("LayerRendererChromium::updateRootLayerScrollbars", this, 0);
if (m_viewportVisibleRect.width() > m_viewportContentRect.width()) {
IntRect verticalScrollbar = verticalScrollbarRect();
IntSize tileSize = verticalScrollbar.size().shrunkTo(IntSize(m_maxTextureSize, m_maxTextureSize));
......@@ -276,6 +279,7 @@ void LayerRendererChromium::updateAndDrawLayers()
void LayerRendererChromium::updateLayers(Vector<CCLayerImpl*>& renderSurfaceLayerList)
{
TRACE_EVENT("LayerRendererChromium::updateLayers", this, 0);
CCLayerImpl* rootDrawLayer = m_rootLayer->ccLayerImpl();
if (!rootDrawLayer->renderSurface())
......@@ -307,6 +311,7 @@ void LayerRendererChromium::updateLayers(Vector<CCLayerImpl*>& renderSurfaceLaye
void LayerRendererChromium::drawLayers(const Vector<CCLayerImpl*>& renderSurfaceLayerList)
{
TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0);
CCLayerImpl* rootDrawLayer = m_rootLayer->ccLayerImpl();
makeContextCurrent();
......@@ -382,11 +387,13 @@ void LayerRendererChromium::drawLayers(const Vector<CCLayerImpl*>& renderSurface
void LayerRendererChromium::finish()
{
TRACE_EVENT("LayerRendererChromium::finish", this, 0);
m_context->finish();
}
void LayerRendererChromium::present()
{
TRACE_EVENT("LayerRendererChromium::present", this, 0);
// We're done! Time to swapbuffers!
// Note that currently this has the same effect as swapBuffers; we should
......
......@@ -34,6 +34,7 @@
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "LayerTexture.h"
#include "TraceEvent.h"
#include <wtf/PassOwnArrayPtr.h>
......@@ -247,10 +248,16 @@ void LayerTilerChromium::update(TilePaintInterface& painter, const IntRect& cont
m_canvas.resize(paintRect.size());
PlatformCanvas::Painter canvasPainter(&m_canvas);
canvasPainter.context()->translate(-paintRect.x(), -paintRect.y());
painter.paint(*canvasPainter.context(), paintRect);
{
TRACE_EVENT("LayerTilerChromium::update::paint", this, 0);
painter.paint(*canvasPainter.context(), paintRect);
}
PlatformCanvas::AutoLocker locker(&m_canvas);
updateFromPixels(paintRect, locker.pixels());
{
TRACE_EVENT("LayerTilerChromium::updateFromPixels", this, 0);
updateFromPixels(paintRect, locker.pixels());
}
}
void LayerTilerChromium::updateFromPixels(const IntRect& paintRect, const uint8_t* paintPixels)
......
2011-03-24 Nat Duca <nduca@chromium.org>
Reviewed by Kenneth Russell.
[chromium] Add traceEvents to compositor
https://bugs.webkit.org/show_bug.cgi?id=56965
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::composite):
2011-03-24 Dominic Mazzoni <dmazzoni@google.com>
Reviewed by Dimitri Glazkov.
......
......@@ -77,7 +77,6 @@
#include "PageGroup.h"
#include "PageGroupLoadDeferrer.h"
#include "Pasteboard.h"
#include "PlatformBridge.h"
#include "PlatformContextSkia.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
......@@ -93,6 +92,7 @@
#include "Settings.h"
#include "SpeechInputClientImpl.h"
#include "Timer.h"
#include "TraceEvent.h"
#include "TypingCommand.h"
#include "UserGestureIndicator.h"
#include "Vector.h"
......@@ -1086,6 +1086,7 @@ void WebViewImpl::themeChanged()
void WebViewImpl::composite(bool finish)
{
#if USE(ACCELERATED_COMPOSITING)
TRACE_EVENT("WebViewImpl::composite", this, 0);
if (m_recreatingGraphicsContext) {
// reallocateRenderer will request a repaint whether or not it succeeded
// in creating a new context.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment