summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp1
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp5
-rw-r--r--Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp5
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/RasterRenderer.cpp1
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp23
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp1
-rw-r--r--Source/WebKit/android/AndroidLog.h4
-rw-r--r--Source/WebKit/android/jni/PicturePile.cpp1
9 files changed, 40 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 779dba5..5fe9a1f 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -853,6 +853,7 @@ bool GraphicsLayerAndroid::paintContext(LayerAndroid* layer,
if (!layer)
return false;
+ TRACE_METHOD();
SkPicture* picture = paintPicture(rect);
if (!picture)
return false;
diff --git a/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp b/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp
index 4398146..f012c42 100644
--- a/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp
@@ -1,6 +1,10 @@
+#define LOG_TAG "PictureLayerContent"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "PictureLayerContent.h"
+#include "AndroidLog.h"
#include "InspectorCanvas.h"
#include "SkPicture.h"
@@ -90,6 +94,7 @@ void PictureLayerContent::draw(SkCanvas* canvas)
if (!m_picture)
return;
+ TRACE_METHOD();
android::Mutex::Autolock lock(m_drawLock);
SkRect r = SkRect::MakeWH(width(), height());
canvas->clipRect(r);
diff --git a/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp
index b648e72..5d516af 100644
--- a/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/PicturePileLayerContent.cpp
@@ -1,6 +1,10 @@
+#define LOG_TAG "PicturePileLayerContent"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "PicturePileLayerContent.h"
+#include "AndroidLog.h"
#include "SkCanvas.h"
#include "SkPicture.h"
@@ -13,6 +17,7 @@ PicturePileLayerContent::PicturePileLayerContent(const PicturePile& picturePile)
void PicturePileLayerContent::draw(SkCanvas* canvas)
{
+ TRACE_METHOD();
android::Mutex::Autolock lock(m_drawLock);
m_picturePile.draw(canvas);
}
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
index bfa0789..a68c01a 100644
--- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
@@ -384,6 +384,7 @@ bool GLUtils::isPureColorBitmap(const SkBitmap& bitmap, Color& pureColor)
// If the bitmap is the pure color, skip the transfer step, and update the Tile Info.
// This check is taking < 1ms if we do full bitmap check per tile.
// TODO: use the SkPicture to determine whether or not a tile is single color.
+ TRACE_METHOD();
pureColor = Color(Color::transparent);
bitmap.lockPixels();
bool sameColor = true;
@@ -483,6 +484,7 @@ void GLUtils::updateQueueWithBitmap(const TileRenderInfo* renderInfo, const SkBi
bool GLUtils::updateSharedSurfaceTextureWithBitmap(ANativeWindow* anw, const SkBitmap& bitmap)
{
+ TRACE_METHOD();
SkAutoLockPixels alp(bitmap);
if (!bitmap.getPixels())
return false;
diff --git a/Source/WebCore/platform/graphics/android/rendering/RasterRenderer.cpp b/Source/WebCore/platform/graphics/android/rendering/RasterRenderer.cpp
index 47e5c17..8fb4d12 100644
--- a/Source/WebCore/platform/graphics/android/rendering/RasterRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/RasterRenderer.cpp
@@ -67,6 +67,7 @@ RasterRenderer::~RasterRenderer()
void RasterRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* canvas)
{
+ TRACE_METHOD();
if (renderInfo.baseTile->isLayerTile()) {
g_bitmap->setIsOpaque(false);
g_bitmap->eraseARGB(0, 0, 0, 0);
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
index 174720f..520a557 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
@@ -38,6 +38,10 @@ namespace WebCore {
using namespace android::uirenderer;
+// Tag used to display current number of SurfaceCollections.
+// Note: this will only work if one webview is actively drawing at a time.
+static const char* COLLECTION_COUNT_TAG = "CollectionCount";
+
SurfaceCollectionManager::SurfaceCollectionManager()
: m_drawingCollection(0)
, m_paintingCollection(0)
@@ -87,6 +91,12 @@ void SurfaceCollectionManager::swap()
m_paintingCollection = m_queuedCollection;
m_queuedCollection = 0;
+ if (ATRACE_ENABLED()) {
+ ATRACE_INT(COLLECTION_COUNT_TAG,
+ (m_drawingCollection ? 1 : 0)
+ + (m_paintingCollection ? 1 : 0));
+ }
+
ALOGV("SWAPPING COMPLETE, D %p, P %p, Q %p",
m_drawingCollection, m_paintingCollection, m_queuedCollection);
}
@@ -106,6 +116,8 @@ void SurfaceCollectionManager::clearCollections()
m_paintingCollection = 0;
SkSafeUnref(m_queuedCollection);
m_queuedCollection = 0;
+
+ ATRACE_INT(COLLECTION_COUNT_TAG, 0);
}
void SurfaceCollectionManager::updatePaintingCollection(SurfaceCollection* newCollection)
@@ -126,8 +138,10 @@ bool SurfaceCollectionManager::updateWithSurfaceCollection(SurfaceCollection* ne
if (!newCollection || brandNew) {
clearCollections();
- if (brandNew)
+ if (brandNew) {
updatePaintingCollection(newCollection);
+ ATRACE_INT(COLLECTION_COUNT_TAG, 1);
+ }
return false;
}
@@ -157,6 +171,13 @@ bool SurfaceCollectionManager::updateWithSurfaceCollection(SurfaceCollection* ne
// don't have painting collection, paint this one!
updatePaintingCollection(newCollection);
}
+
+ if (ATRACE_ENABLED()) {
+ ATRACE_INT(COLLECTION_COUNT_TAG,
+ (m_drawingCollection ? 1 : 0)
+ + (m_paintingCollection ? 1 : 0)
+ + (m_queuedCollection ? 1 : 0));
+ }
return m_drawingCollection && TilesManager::instance()->useDoubleBuffering();
}
diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
index f37afa4..fa84f0d 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
@@ -391,6 +391,7 @@ void TransferQueue::updateDirtyTiles()
void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo,
const SkBitmap& bitmap)
{
+ TRACE_METHOD();
if (!tryUpdateQueueWithBitmap(renderInfo, bitmap)) {
// failed placing bitmap in queue, discard tile's texture so it will be
// re-enqueued (and repainted)
diff --git a/Source/WebKit/android/AndroidLog.h b/Source/WebKit/android/AndroidLog.h
index f034d35..6b6c1a0 100644
--- a/Source/WebKit/android/AndroidLog.h
+++ b/Source/WebKit/android/AndroidLog.h
@@ -30,6 +30,8 @@
#define LOG_TAG __FILE__
#endif
+#define ATRACE_TAG ATRACE_TAG_WEBVIEW
+
#include <cutils/log.h>
#include <utils/Trace.h>
#include <wtf/CurrentTime.h>
@@ -58,7 +60,7 @@ extern FILE* gRenderTreeFile;
#define INT_RECT_FORMAT "[x=%d,y=%d,w=%d,h=%d]"
#define INT_RECT_ARGS(ir) ir.x(), ir.y(), ir.width(), ir.height()
-#define TRACE_METHOD() android::ScopedTrace __st(ATRACE_TAG_WEBVIEW, __func__);
+#define TRACE_METHOD() android::ScopedTrace __st(ATRACE_TAG, __func__);
#define TIME_METHOD() MethodTimer __method_timer(__func__)
class MethodTimer {
diff --git a/Source/WebKit/android/jni/PicturePile.cpp b/Source/WebKit/android/jni/PicturePile.cpp
index ccdfa59..bdf347a 100644
--- a/Source/WebKit/android/jni/PicturePile.cpp
+++ b/Source/WebKit/android/jni/PicturePile.cpp
@@ -81,7 +81,6 @@ void PicturePile::draw(SkCanvas* canvas)
* the rect bounds of the SkRegion for the clip, so this still can't be
* used for translucent surfaces
*/
- TRACE_METHOD();
IntRect clipBounds = extractClipBounds(canvas, m_size);
SkRegion clipRegion(toSkIRect(clipBounds));
drawWithClipRecursive(canvas, clipRegion, m_pile.size() - 1);