summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-06-13 14:23:48 -0700
committerChris Craik <ccraik@google.com>2012-06-13 14:48:15 -0700
commit736e83761cd309092370bb9f7842826186c32722 (patch)
tree5bbb80f672e8dadfa5f81dbe76c7d7b394bde4cd /Source/WebCore/platform/graphics
parent236f8ddfbd94fc6e0e49c13495c8fe82d3218bc8 (diff)
downloadexternal_webkit-736e83761cd309092370bb9f7842826186c32722.zip
external_webkit-736e83761cd309092370bb9f7842826186c32722.tar.gz
external_webkit-736e83761cd309092370bb9f7842826186c32722.tar.bz2
Add detailed tracing to tile painting
bug:6653638 Change-Id: I839917feb1803bc1f4ace5aa2367067024a18706
Diffstat (limited to 'Source/WebCore/platform/graphics')
-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
7 files changed, 37 insertions, 1 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)