summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-03-09 15:42:19 -0800
committerChris Craik <ccraik@google.com>2012-03-12 12:59:12 -0700
commitd487c56b47c747d3e331ee1892e4c0473363afd2 (patch)
treec29ead08645cc99341d11bc92f1c73c2dc783d4b /Source/WebCore
parent146f4231e665a454284a465ff66379b9277f1fc0 (diff)
downloadexternal_webkit-d487c56b47c747d3e331ee1892e4c0473363afd2.zip
external_webkit-d487c56b47c747d3e331ee1892e4c0473363afd2.tar.gz
external_webkit-d487c56b47c747d3e331ee1892e4c0473363afd2.tar.bz2
replace XLOGC/XLOG with ALOGD/ALOGV
Started using ALOGW/E for indicating warnings/errors Also delete the unused TilesTracker.h Change-Id: I1986a3057efd4c8e260dbc020e21c02d4d646cf3
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/AndroidAnimation.cpp45
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp69
-rw-r--r--Source/WebCore/platform/graphics/android/BaseRenderer.cpp24
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTile.cpp65
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTileTexture.cpp26
-rw-r--r--Source/WebCore/platform/graphics/android/ClassTracker.cpp43
-rw-r--r--Source/WebCore/platform/graphics/android/FixedPositioning.cpp9
-rw-r--r--Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp1
-rw-r--r--Source/WebCore/platform/graphics/android/GLExtras.cpp26
-rw-r--r--Source/WebCore/platform/graphics/android/GLUtils.cpp63
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp80
-rw-r--r--Source/WebCore/platform/graphics/android/GaneshContext.cpp31
-rw-r--r--Source/WebCore/platform/graphics/android/GaneshRenderer.cpp30
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp102
-rw-r--r--Source/WebCore/platform/graphics/android/IFrameContentLayerAndroid.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/IFrameLayerAndroid.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/ImageTexture.cpp29
-rw-r--r--Source/WebCore/platform/graphics/android/ImagesManager.cpp23
-rw-r--r--Source/WebCore/platform/graphics/android/InspectorCanvas.cpp30
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.cpp44
-rw-r--r--Source/WebCore/platform/graphics/android/LayerGroup.cpp45
-rw-r--r--Source/WebCore/platform/graphics/android/MediaLayer.cpp30
-rw-r--r--Source/WebCore/platform/graphics/android/MediaListener.h15
-rw-r--r--Source/WebCore/platform/graphics/android/MediaTexture.cpp27
-rw-r--r--Source/WebCore/platform/graphics/android/PerformanceMonitor.cpp15
-rw-r--r--Source/WebCore/platform/graphics/android/RasterRenderer.cpp18
-rw-r--r--Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp8
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.cpp30
-rw-r--r--Source/WebCore/platform/graphics/android/SurfaceCollection.cpp27
-rw-r--r--Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp63
-rw-r--r--Source/WebCore/platform/graphics/android/TexturesGenerator.cpp32
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.cpp38
-rw-r--r--Source/WebCore/platform/graphics/android/TiledTexture.cpp87
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp87
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.h7
-rw-r--r--Source/WebCore/platform/graphics/android/TilesProfiler.cpp35
-rw-r--r--Source/WebCore/platform/graphics/android/TilesTracker.h85
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.cpp59
-rw-r--r--Source/WebCore/platform/graphics/android/VideoLayerAndroid.cpp21
-rw-r--r--Source/WebCore/platform/graphics/android/VideoLayerManager.cpp37
-rw-r--r--Source/WebCore/platform/graphics/android/ZoomManager.cpp24
41 files changed, 489 insertions, 1061 deletions
diff --git a/Source/WebCore/platform/graphics/android/AndroidAnimation.cpp b/Source/WebCore/platform/graphics/android/AndroidAnimation.cpp
index 6b22359..0ef84b9 100644
--- a/Source/WebCore/platform/graphics/android/AndroidAnimation.cpp
+++ b/Source/WebCore/platform/graphics/android/AndroidAnimation.cpp
@@ -14,39 +14,22 @@
* limitations under the License.
*/
+#define LOG_TAG "AndroidAnimation"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "AndroidAnimation.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "Animation.h"
#include "GraphicsLayerAndroid.h"
-
#include "Timer.h"
#include "TimingFunction.h"
#include "TranslateTransformOperation.h"
#include "UnitBezier.h"
-#include <wtf/CurrentTime.h>
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "AndroidAnimation", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "AndroidAnimation", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
-
namespace WebCore {
static int gUniqueId;
@@ -251,10 +234,10 @@ void AndroidOpacityAnimation::applyForProgress(LayerAndroid* layer, float progre
FloatAnimationValue* fromValue = (FloatAnimationValue*) m_operations->at(from);
FloatAnimationValue* toValue = (FloatAnimationValue*) m_operations->at(to);
- XLOG("[layer %d] opacity fromValue %x, key %.2f, toValue %x, key %.2f for progress %.2f",
- layer->uniqueId(),
- fromValue, fromValue->keyTime(),
- toValue, toValue->keyTime(), progress);
+ ALOGV("[layer %d] opacity fromValue %x, key %.2f, toValue %x, key %.2f for progress %.2f",
+ layer->uniqueId(),
+ fromValue, fromValue->keyTime(),
+ toValue, toValue->keyTime(), progress);
// We now have the correct two values to work with, let's compute the
// progress value
@@ -293,10 +276,10 @@ void AndroidTransformAnimation::applyForProgress(LayerAndroid* layer, float prog
TransformAnimationValue* fromValue = (TransformAnimationValue*) m_operations->at(from);
TransformAnimationValue* toValue = (TransformAnimationValue*) m_operations->at(to);
- XLOG("[layer %d] fromValue %x, key %.2f, toValue %x, key %.2f for progress %.2f",
- layer->uniqueId(),
- fromValue, fromValue->keyTime(),
- toValue, toValue->keyTime(), progress);
+ ALOGV("[layer %d] fromValue %x, key %.2f, toValue %x, key %.2f for progress %.2f",
+ layer->uniqueId(),
+ fromValue, fromValue->keyTime(),
+ toValue, toValue->keyTime(), progress);
// We now have the correct two values to work with, let's compute the
// progress value
@@ -304,8 +287,8 @@ void AndroidTransformAnimation::applyForProgress(LayerAndroid* layer, float prog
const TimingFunction* timingFunction = fromValue->timingFunction();
float p = applyTimingFunction(fromValue->keyTime(), toValue->keyTime(),
progress, timingFunction);
- XLOG("progress %.2f => %.2f from: %.2f to: %.2f", progress, p, fromValue->keyTime(),
- toValue->keyTime());
+ ALOGV("progress %.2f => %.2f from: %.2f to: %.2f", progress, p, fromValue->keyTime(),
+ toValue->keyTime());
progress = p;
// With both values and the progress, we also need to check out that
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index c9a8b9a..f27f2c1 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -23,10 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "BaseLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "BaseLayerAndroid.h"
-#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "ClassTracker.h"
#include "GLUtils.h"
#include "LayerGroup.h"
@@ -34,26 +37,6 @@
#include "SkCanvas.h"
#include "TilesManager.h"
#include <GLES2/gl2.h>
-#include <wtf/CurrentTime.h>
-#endif // USE(ACCELERATED_COMPOSITING)
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "BaseLayerAndroid", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "BaseLayerAndroid", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
// TODO: dynamically determine based on DPI
#define PREFETCH_SCALE_MODIFIER 0.3
@@ -120,23 +103,23 @@ void BaseLayerAndroid::prefetchBasePicture(const SkRect& viewport, float current
bool goingLeft = m_state->goingLeft();
- XLOG("fetch rect %f %f %f %f, scale %f",
- viewport.fLeft,
- viewport.fTop,
- viewport.fRight,
- viewport.fBottom,
- currentScale);
+ ALOGV("fetch rect %f %f %f %f, scale %f",
+ viewport.fLeft,
+ viewport.fTop,
+ viewport.fRight,
+ viewport.fBottom,
+ currentScale);
bounds.fLeft = static_cast<int>(floorf(viewport.fLeft * invTileWidth)) - PREFETCH_X_DIST;
bounds.fTop = static_cast<int>(floorf(viewport.fTop * invTileHeight)) - PREFETCH_Y_DIST;
bounds.fRight = static_cast<int>(ceilf(viewport.fRight * invTileWidth)) + PREFETCH_X_DIST;
bounds.fBottom = static_cast<int>(ceilf(viewport.fBottom * invTileHeight)) + PREFETCH_Y_DIST;
- XLOG("prefetch rect %d %d %d %d, scale %f, preparing page %p",
- bounds.fLeft, bounds.fTop,
- bounds.fRight, bounds.fBottom,
- prefetchScale,
- prefetchTiledPage);
+ ALOGV("prefetch rect %d %d %d %d, scale %f, preparing page %p",
+ bounds.fLeft, bounds.fTop,
+ bounds.fRight, bounds.fBottom,
+ prefetchScale,
+ prefetchTiledPage);
prefetchTiledPage->setScale(prefetchScale);
prefetchTiledPage->updateTileDirtiness();
@@ -152,12 +135,12 @@ bool BaseLayerAndroid::isReady()
{
ZoomManager* zoomManager = m_state->zoomManager();
if (ZoomManager::kNoScaleRequest != zoomManager->scaleRequestState()) {
- XLOG("base layer not ready, still zooming");
+ ALOGV("base layer not ready, still zooming");
return false; // still zooming
}
if (!m_state->frontPage()->isReady(m_state->preZoomBounds())) {
- XLOG("base layer not ready, front page not done painting");
+ ALOGV("base layer not ready, front page not done painting");
return false;
}
@@ -175,7 +158,7 @@ void BaseLayerAndroid::swapTiles()
void BaseLayerAndroid::setIsPainting()
{
- XLOG("BLA %p setIsPainting, dirty %d", this, isDirty());
+ ALOGV("BLA %p setIsPainting, dirty %d", this, isDirty());
m_state->invalRegion(m_dirtyRegion);
m_dirtyRegion.setEmpty();
}
@@ -187,7 +170,7 @@ void BaseLayerAndroid::mergeInvalsInto(BaseLayerAndroid* replacementLayer)
void BaseLayerAndroid::prepareGL(const SkRect& viewport, float scale, double currentTime)
{
- XLOG("prepareGL BLA %p, m_state %p", this, m_state);
+ ALOGV("prepareGL BLA %p, m_state %p", this, m_state);
ZoomManager* zoomManager = m_state->zoomManager();
@@ -195,8 +178,8 @@ void BaseLayerAndroid::prepareGL(const SkRect& viewport, float scale, double cur
bool goingLeft = m_state->goingLeft();
const SkIRect& viewportTileBounds = m_state->viewportTileBounds();
- XLOG("drawBasePicture, TX: %d, TY: %d scale %.2f", viewportTileBounds.fLeft,
- viewportTileBounds.fTop, scale);
+ ALOGV("drawBasePicture, TX: %d, TY: %d scale %.2f", viewportTileBounds.fLeft,
+ viewportTileBounds.fTop, scale);
// Query the resulting state from the zoom manager
bool prepareNextTiledPage = zoomManager->needPrepareNextTiledPage();
@@ -256,7 +239,7 @@ void BaseLayerAndroid::prepareGL(const SkRect& viewport, float scale, double cur
tiledPage->prepare(goingDown, goingLeft, preZoomBounds,
TiledPage::ExpandedBounds);
- XLOG("scrollState %d, zooming %d", m_scrollState, zooming);
+ ALOGV("scrollState %d, zooming %d", m_scrollState, zooming);
// prefetch in the nextTiledPage if unused by zooming (even if not scrolling
// since we want the tiles to be ready before they're needed)
@@ -291,9 +274,9 @@ void BaseLayerAndroid::updateLayerPositions(const SkRect& visibleRect)
#ifdef DEBUG
compositedRoot->showLayer(0);
- XLOG("We have %d layers, %d textured",
- compositedRoot->nbLayers(),
- compositedRoot->nbTexturedLayers());
+ ALOGV("We have %d layers, %d textured",
+ compositedRoot->nbLayers(),
+ compositedRoot->nbTexturedLayers());
#endif
}
@@ -301,7 +284,7 @@ void BaseLayerAndroid::updateLayerPositions(const SkRect& visibleRect)
void BaseLayerAndroid::drawGL(float scale)
{
- XLOG("drawGL BLA %p", this);
+ ALOGV("drawGL BLA %p", this);
// TODO: consider moving drawBackground outside of prepare (into tree manager)
m_state->drawBackground(m_color);
diff --git a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
index 832ed0c..6dd16e1 100644
--- a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
@@ -23,12 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "BaseRenderer"
+#define LOG_NDEBUG 1
#include "config.h"
#include "BaseRenderer.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "GaneshRenderer.h"
#include "GLUtils.h"
#include "RasterRenderer.h"
@@ -41,24 +44,6 @@
#include <wtf/text/CString.h>
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "BaseRenderer", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "BaseRenderer", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
#define UPDATE_COUNT_MASK 0xFF // displayed count wraps at 256
#define UPDATE_COUNT_ALPHA_MASK 0x3F // alpha wraps at 64
@@ -127,7 +112,8 @@ void BaseRenderer::renderTiledContent(const TileRenderInfo& renderInfo)
setupCanvas(renderInfo, &canvas);
if (!canvas.getDevice()) {
- XLOG("Error: No Device");
+ // TODO: consider ALOGE
+ ALOGV("Error: No Device");
return;
}
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp
index de64425..b5c0f0a 100644
--- a/Source/WebCore/platform/graphics/android/BaseTile.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp
@@ -23,37 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "BaseTile"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "BaseTile.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "GLUtils.h"
#include "RasterRenderer.h"
#include "TextureInfo.h"
#include "TilesManager.h"
-#include <cutils/atomic.h>
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTile", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTile", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// If the dirty portion of a tile exceeds this ratio, fully repaint.
// Lower values give fewer partial repaints, thus fewer front-to-back
// texture copies (cost will vary by device). It's a tradeoff between
@@ -127,14 +110,14 @@ void BaseTile::reserveTexture()
android::AutoMutex lock(m_atomicSync);
if (texture && m_backTexture != texture) {
- XLOG("tile %p reserving texture %p, back was %p (front %p)",
- this, texture, m_backTexture, m_frontTexture);
+ ALOGV("tile %p reserving texture %p, back was %p (front %p)",
+ this, texture, m_backTexture, m_frontTexture);
m_state = Unpainted;
m_backTexture = texture;
}
if (m_state == UpToDate) {
- XLOG("moving tile %p to unpainted, since it reserved while up to date", this);
+ ALOGV("moving tile %p to unpainted, since it reserved while up to date", this);
m_dirty = true;
m_state = Unpainted;
}
@@ -142,13 +125,13 @@ void BaseTile::reserveTexture()
bool BaseTile::removeTexture(BaseTileTexture* texture)
{
- XLOG("%p removeTexture %p, back %p front %p... page %p",
- this, texture, m_backTexture, m_frontTexture, m_page);
+ ALOGV("%p removeTexture %p, back %p front %p... page %p",
+ this, texture, m_backTexture, m_frontTexture, m_page);
// We update atomically, so paintBitmap() can see the correct value
android::AutoMutex lock(m_atomicSync);
if (m_frontTexture == texture) {
if (m_state == UpToDate) {
- XLOG("front texture removed, state was UpToDate, now becoming unpainted, bt is %p", m_backTexture);
+ ALOGV("front texture removed, state was UpToDate, now becoming unpainted, bt is %p", m_backTexture);
m_state = Unpainted;
}
@@ -206,7 +189,7 @@ void BaseTile::markAsDirty(const SkRegion& dirtyArea)
} else if (m_state != Unpainted) {
// TODO: fix it so that they can paint while deferring the markAsDirty
// call (or block updates)
- XLOG("Warning: tried to mark tile %p at %d, %d islayertile %d as dirty, state %d, page %p",
+ ALOGV("Warning: tried to mark tile %p at %d, %d islayertile %d as dirty, state %d, page %p",
this, m_x, m_y, isLayerTile(), m_state, m_page);
// prefetch tiles can be marked dirty while in the process of painting,
@@ -324,7 +307,7 @@ void BaseTile::paintBitmap()
return;
}
if (m_state != Unpainted) {
- XLOG("Warning: started painting tile %p, but was at state %d, ft %p bt %p",
+ ALOGV("Warning: started painting tile %p, but was at state %d, ft %p bt %p",
this, m_state, m_frontTexture, m_backTexture);
}
m_state = PaintingStarted;
@@ -447,12 +430,12 @@ void BaseTile::paintBitmap()
if (!m_dirtyArea.isEmpty())
m_dirty = true;
- XLOG("painted tile %p (%d, %d), texture %p, dirty=%d", this, x, y, texture, m_dirty);
+ ALOGV("painted tile %p (%d, %d), texture %p, dirty=%d", this, x, y, texture, m_dirty);
validatePaint();
} else {
- XLOG("tile %p no longer owns texture %p, m_state %d. ft %p bt %p",
- this, texture, m_state, m_frontTexture, m_backTexture);
+ ALOGV("tile %p no longer owns texture %p, m_state %d. ft %p bt %p",
+ this, texture, m_state, m_frontTexture, m_backTexture);
}
m_atomicSync.unlock();
@@ -460,8 +443,8 @@ void BaseTile::paintBitmap()
void BaseTile::discardTextures() {
android::AutoMutex lock(m_atomicSync);
- XLOG("%p discarding bt %p, ft %p",
- this, m_backTexture, m_frontTexture);
+ ALOGV("%p discarding bt %p, ft %p",
+ this, m_backTexture, m_frontTexture);
if (m_frontTexture) {
m_frontTexture->release(this);
m_frontTexture = 0;
@@ -497,8 +480,8 @@ bool BaseTile::swapTexturesIfNeeded() {
m_frontTexture = m_backTexture;
m_backTexture = 0;
m_state = UpToDate;
- XLOG("display texture for %p at %d, %d front is now %p, back is %p",
- this, m_x, m_y, m_frontTexture, m_backTexture);
+ ALOGV("display texture for %p at %d, %d front is now %p, back is %p",
+ this, m_x, m_y, m_frontTexture, m_backTexture);
return true;
}
@@ -513,8 +496,8 @@ void BaseTile::backTextureTransfer() {
m_state = ReadyToSwap;
else {
// shouldn't have transferred a tile in any other state, log
- XLOG("Note: transferred tile %p at %d %d, state wasn't paintingstarted or validated: %d",
- this, m_x, m_y, m_state);
+ ALOGV("Note: transferred tile %p at %d %d, state wasn't paintingstarted or validated: %d",
+ this, m_x, m_y, m_state);
}
}
@@ -542,7 +525,7 @@ void BaseTile::validatePaint() {
// to reset m_dirty bit to true.
m_state = ReadyToSwap;
} else {
- XLOG("Note: validated tile %p at %d %d, state wasn't paintingstarted or transferred %d",
+ ALOGV("Note: validated tile %p at %d %d, state wasn't paintingstarted or transferred %d",
this, m_x, m_y, m_state);
// failed transferring, in which case mark dirty (since
// paintBitmap() may have cleared m_dirty)
@@ -550,11 +533,11 @@ void BaseTile::validatePaint() {
}
if (m_deferredDirty) {
- XLOG("Note: deferred dirty flag set, possibly a missed paint on tile %p", this);
+ ALOGV("Note: deferred dirty flag set, possibly a missed paint on tile %p", this);
m_deferredDirty = false;
}
} else {
- XLOG("Note: paint was unsuccessful.");
+ ALOGV("Note: paint was unsuccessful.");
m_state = Unpainted;
}
diff --git a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
index 9403584..ec1fac2 100644
--- a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp
@@ -23,32 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "BaseTileTexture"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "BaseTileTexture.h"
+#include "AndroidLog.h"
#include "BaseTile.h"
#include "ClassTracker.h"
#include "GLUtils.h"
#include "TilesManager.h"
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTileTexture", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "BaseTileTexture", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
BaseTileTexture::BaseTileTexture(uint32_t w, uint32_t h)
@@ -112,7 +98,7 @@ bool BaseTileTexture::setOwner(TextureOwner* owner, bool force)
bool BaseTileTexture::release(TextureOwner* owner)
{
- XLOG("texture %p releasing tile %p, m_owner %p", this, owner, m_owner);
+ ALOGV("texture %p releasing tile %p, m_owner %p", this, owner, m_owner);
if (m_owner != owner)
return false;
@@ -126,7 +112,7 @@ void BaseTileTexture::transferComplete()
BaseTile* owner = static_cast<BaseTile*>(m_owner);
owner->backTextureTransfer();
} else
- XLOGC("ERROR: owner missing after transfer of texture %p", this);
+ ALOGE("ERROR: owner missing after transfer of texture %p", this);
}
void BaseTileTexture::drawGL(bool isLayer, const SkRect& rect, float opacity,
diff --git a/Source/WebCore/platform/graphics/android/ClassTracker.cpp b/Source/WebCore/platform/graphics/android/ClassTracker.cpp
index eb810a8..98e33d9 100644
--- a/Source/WebCore/platform/graphics/android/ClassTracker.cpp
+++ b/Source/WebCore/platform/graphics/android/ClassTracker.cpp
@@ -23,19 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "ClassTracker"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ClassTracker.h"
+#include "AndroidLog.h"
#include "LayerAndroid.h"
#include "TilesManager.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
#include <wtf/text/CString.h>
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "ClassTracker", __VA_ARGS__)
-
#define DEBUG_LAYERS
#undef DEBUG_LAYERS
@@ -85,12 +84,12 @@ void ClassTracker::remove(LayerAndroid* layer)
void ClassTracker::show()
{
android::Mutex::Autolock lock(m_lock);
- XLOG("*** Tracking %d classes ***", m_classes.size());
+ ALOGD("*** Tracking %d classes ***", m_classes.size());
for (HashMap<String, int>::iterator iter = m_classes.begin(); iter != m_classes.end(); ++iter) {
- XLOG("class %s has %d instances",
- iter->first.latin1().data(), iter->second);
+ ALOGD("class %s has %d instances",
+ iter->first.latin1().data(), iter->second);
}
- XLOG("*** %d Layers ***", m_layers.size());
+ ALOGD("*** %d Layers ***", m_layers.size());
int nbTextures = 0;
int nbAllocatedTextures = 0;
int nbLayerTextures = 0;
@@ -98,23 +97,23 @@ void ClassTracker::show()
float textureSize = 256 * 256 * 4 / 1024.0 / 1024.0;
TilesManager::instance()->gatherTexturesNumbers(&nbTextures, &nbAllocatedTextures,
&nbLayerTextures, &nbAllocatedLayerTextures);
- XLOG("*** textures: %d/%d (%.2f Mb), layer textures: %d/%d (%.2f Mb) : total used %.2f Mb",
- nbAllocatedTextures, nbTextures,
- nbAllocatedTextures * textureSize,
- nbAllocatedLayerTextures, nbLayerTextures,
- nbAllocatedLayerTextures * textureSize,
- (nbAllocatedTextures + nbAllocatedLayerTextures) * textureSize);
+ ALOGD("*** textures: %d/%d (%.2f Mb), layer textures: %d/%d (%.2f Mb) : total used %.2f Mb",
+ nbAllocatedTextures, nbTextures,
+ nbAllocatedTextures * textureSize,
+ nbAllocatedLayerTextures, nbLayerTextures,
+ nbAllocatedLayerTextures * textureSize,
+ (nbAllocatedTextures + nbAllocatedLayerTextures) * textureSize);
#ifdef DEBUG_LAYERS
for (unsigned int i = 0; i < m_layers.size(); i++) {
LayerAndroid* layer = m_layers[i];
- XLOG("[%d/%d] layer %x (%.2f, %.2f) of type %d, refcount(%d) has texture %x has image ref %x (%x) root: %x parent: %x",
- i, m_layers.size(), layer,
- layer->getWidth(), layer->getHeight(),
- layer->type(), layer->getRefCnt(),
- layer->texture(), layer->imageRef(),
- layer->imageTexture(), (LayerAndroid*) layer->getRootLayer(),
- (LayerAndroid*) layer->getParent());
+ ALOGD("[%d/%d] layer %x (%.2f, %.2f) of type %d, refcount(%d) has texture %x has image ref %x (%x) root: %x parent: %x",
+ i, m_layers.size(), layer,
+ layer->getWidth(), layer->getHeight(),
+ layer->type(), layer->getRefCnt(),
+ layer->texture(), layer->imageRef(),
+ layer->imageTexture(), (LayerAndroid*) layer->getRootLayer(),
+ (LayerAndroid*) layer->getParent());
}
#endif
}
diff --git a/Source/WebCore/platform/graphics/android/FixedPositioning.cpp b/Source/WebCore/platform/graphics/android/FixedPositioning.cpp
index 140411a..989eebd 100644
--- a/Source/WebCore/platform/graphics/android/FixedPositioning.cpp
+++ b/Source/WebCore/platform/graphics/android/FixedPositioning.cpp
@@ -1,17 +1,16 @@
+#define LOG_TAG "FixedPositioning"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "FixedPositioning.h"
+#include "AndroidLog.h"
#include "DumpLayer.h"
#include "IFrameLayerAndroid.h"
#include "TilesManager.h"
#if USE(ACCELERATED_COMPOSITING)
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "FixedPositioning", __VA_ARGS__)
-
namespace WebCore {
// Called when copying the layer tree to the UI
diff --git a/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp b/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp
index 4fc3b4e..5696a46 100644
--- a/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp
@@ -34,7 +34,6 @@
#include "SkPaint.h"
#include "SkTypeface.h"
#include "SkUtils.h"
-#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/android/GLExtras.cpp b/Source/WebCore/platform/graphics/android/GLExtras.cpp
index dc983a6..1676489 100644
--- a/Source/WebCore/platform/graphics/android/GLExtras.cpp
+++ b/Source/WebCore/platform/graphics/android/GLExtras.cpp
@@ -23,32 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "GLExtras"
+#define LOG_NDEBUG 1
+
#include "config.h"
+#include "AndroidLog.h"
#include "DrawExtra.h"
#include "GLExtras.h"
#include "IntRect.h"
#include "TilesManager.h"
#include "android_graphics.h"
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "GLExtras", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GLExtras", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// Touch ring border width. This is doubled if the ring is not pressed
#define RING_BORDER_WIDTH 1
@@ -68,8 +54,8 @@ void GLExtras::drawRing(SkRect& srcRect, Color color, const TransformationMatrix
// Invalid rect, reject it
return;
}
- XLOG("drawQuad [%fx%f, %f, %f]", srcRect.fLeft, srcRect.fTop,
- srcRect.width(), srcRect.height());
+ ALOGV("drawQuad [%fx%f, %f, %f]", srcRect.fLeft, srcRect.fTop,
+ srcRect.width(), srcRect.height());
// Pull the alpha out of the color so that the shader applies it correctly.
// Otherwise we either don't have blending enabled, or the alpha will get
// double applied
diff --git a/Source/WebCore/platform/graphics/android/GLUtils.cpp b/Source/WebCore/platform/graphics/android/GLUtils.cpp
index 3024d28..ecd6bce 100644
--- a/Source/WebCore/platform/graphics/android/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/GLUtils.cpp
@@ -23,6 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "GLUtils"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "GLUtils.h"
@@ -31,25 +34,9 @@
#include "ShaderProgram.h"
#include "TilesManager.h"
-#include <cutils/log.h>
+#include <AndroidLog.h>
#include <gui/SurfaceTexture.h>
#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "GLUtils", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GLUtils", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
// We will limit GL error logging for LOG_VOLUME_PER_CYCLE times every
// LOG_VOLUME_PER_CYCLE seconds.
@@ -148,7 +135,7 @@ static void crashIfOOM(GLint errorCode)
{
const GLint OOM_ERROR_CODE = 0x505;
if (errorCode == OOM_ERROR_CODE) {
- XLOGC("ERROR: Fatal OOM detected.");
+ ALOGE("ERROR: Fatal OOM detected.");
CRASH();
}
}
@@ -159,14 +146,14 @@ void GLUtils::checkEglError(const char* op, EGLBoolean returnVal)
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("EGL ERROR - %s() returned %d\n", op, returnVal);
+ ALOGE("EGL ERROR - %s() returned %d\n", op, returnVal);
}
for (EGLint error = eglGetError(); error != EGL_SUCCESS; error = eglGetError()) {
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("after %s() eglError (0x%x)\n", op, error);
+ ALOGE("after %s() eglError (0x%x)\n", op, error);
crashIfOOM(error);
}
}
@@ -178,7 +165,7 @@ bool GLUtils::checkGlError(const char* op)
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("GL ERROR - after %s() glError (0x%x)\n", op, error);
+ ALOGE("GL ERROR - after %s() glError (0x%x)\n", op, error);
crashIfOOM(error);
ret = true;
}
@@ -192,7 +179,7 @@ bool GLUtils::checkGlErrorOn(void* p, const char* op)
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("GL ERROR on %x - after %s() glError (0x%x)\n", p, op, error);
+ ALOGE("GL ERROR on %x - after %s() glError (0x%x)\n", p, op, error);
crashIfOOM(error);
ret = true;
}
@@ -205,7 +192,7 @@ void GLUtils::checkSurfaceTextureError(const char* functionName, int status)
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("ERROR at calling %s status is (%d)", functionName, status);
+ ALOGE("ERROR at calling %s status is (%d)", functionName, status);
}
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -313,7 +300,7 @@ EGLContext GLUtils::createBackgroundContext(EGLContext sharedContext)
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
checkEglError("eglGetDisplay");
if (display == EGL_NO_DISPLAY) {
- XLOG("eglGetDisplay returned EGL_NO_DISPLAY");
+ ALOGE("eglGetDisplay returned EGL_NO_DISPLAY");
return EGL_NO_CONTEXT;
}
@@ -322,7 +309,7 @@ EGLContext GLUtils::createBackgroundContext(EGLContext sharedContext)
EGLBoolean returnValue = eglInitialize(display, &majorVersion, &minorVersion);
checkEglError("eglInitialize", returnValue);
if (returnValue != EGL_TRUE) {
- XLOG("eglInitialize failed\n");
+ ALOGE("eglInitialize failed\n");
return EGL_NO_CONTEXT;
}
@@ -336,14 +323,14 @@ EGLContext GLUtils::createBackgroundContext(EGLContext sharedContext)
EGLContext context = eglCreateContext(display, config, sharedContext, contextAttribs);
checkEglError("eglCreateContext");
if (context == EGL_NO_CONTEXT) {
- XLOG("eglCreateContext failed\n");
+ ALOGE("eglCreateContext failed\n");
return EGL_NO_CONTEXT;
}
returnValue = eglMakeCurrent(display, surface, surface, context);
checkEglError("eglMakeCurrent", returnValue);
if (returnValue != EGL_TRUE) {
- XLOG("eglMakeCurrent failed\n");
+ ALOGE("eglMakeCurrent failed\n");
return EGL_NO_CONTEXT;
}
@@ -455,8 +442,8 @@ bool GLUtils::isPureColorBitmap(const SkBitmap& bitmap, Color& pureColor)
if (sameColor) {
char* rgbaPtr = static_cast<char*>(bitmap.getPixels());
pureColor = Color(rgbaPtr[0], rgbaPtr[1], rgbaPtr[2], rgbaPtr[3]);
- XLOG("sameColor tile found , %x at (%d, %d, %d, %d)",
- *firstPixelPtr, rgbaPtr[0], rgbaPtr[1], rgbaPtr[2], rgbaPtr[3]);
+ ALOGV("sameColor tile found , %x at (%d, %d, %d, %d)",
+ *firstPixelPtr, rgbaPtr[0], rgbaPtr[1], rgbaPtr[2], rgbaPtr[3]);
}
bitmap.unlockPixels();
@@ -509,9 +496,9 @@ void GLUtils::paintTextureWithBitmap(const TileRenderInfo* renderInfo,
GLUtils::updateSharedSurfaceTextureWithBitmap(renderInfo, bitmap);
else {
if (!requiredSize.equals(bitmap.width(), bitmap.height())) {
- XLOG("The bitmap size (%d,%d) does not equal the texture size (%d,%d)",
- bitmap.width(), bitmap.height(),
- requiredSize.width(), requiredSize.height());
+ ALOGV("The bitmap size (%d,%d) does not equal the texture size (%d,%d)",
+ bitmap.width(), bitmap.height(),
+ requiredSize.width(), requiredSize.height());
}
GLUtils::updateSharedSurfaceTextureWithBitmap(renderInfo, bitmap);
@@ -547,9 +534,9 @@ void GLUtils::createTextureWithBitmap(GLuint texture, const SkBitmap& bitmap, GL
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("GL ERROR: glTexImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
- " internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
- bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
+ ALOGE("GL ERROR: glTexImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
+ " internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
+ bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
@@ -587,9 +574,9 @@ void GLUtils::updateTextureWithBitmap(GLuint texture, const SkBitmap& bitmap,
#ifndef DEBUG
if (allowGLLog())
#endif
- XLOGC("GL ERROR: glTexSubImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
- " internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
- bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
+ ALOGE("GL ERROR: glTexSubImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
+ " internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
+ bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index 97bd7a8..663addb 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "GLWebViewState"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "GLWebViewState.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "BaseLayerAndroid.h"
#include "ClassTracker.h"
#include "GLUtils.h"
@@ -36,28 +40,10 @@
#include "ScrollableLayerAndroid.h"
#include "SkPath.h"
#include "TilesManager.h"
-#include "TilesTracker.h"
#include "SurfaceCollection.h"
#include "SurfaceCollectionManager.h"
-#include <cutils/log.h>
#include <pthread.h>
#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "GLWebViewState", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GLWebViewState", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
#define FIRST_TILED_PAGE_ID 1
#define SECOND_TILED_PAGE_ID 2
@@ -139,7 +125,7 @@ bool GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, bool showVisualIndica
m_layersRenderingMode = kAllTextures;
}
if (layer) {
- XLOG("new base layer %p, with child %p", layer, layer->getChild(0));
+ ALOGV("new base layer %p, with child %p", layer, layer->getChild(0));
layer->setState(this);
}
bool queueFull = m_surfaceCollectionManager.updateWithSurfaceCollection(
@@ -193,9 +179,9 @@ void GLWebViewState::inval(const IntRect& rect)
m_frameworkInval = rect;
else
m_frameworkInval.unite(rect);
- XLOG("intermediate invalRect(%d, %d, %d, %d) after unite with rect %d %d %d %d", m_frameworkInval.x(),
- m_frameworkInval.y(), m_frameworkInval.width(), m_frameworkInval.height(),
- rect.x(), rect.y(), rect.width(), rect.height());
+ ALOGV("intermediate invalRect(%d, %d, %d, %d) after unite with rect %d %d %d %d", m_frameworkInval.x(),
+ m_frameworkInval.y(), m_frameworkInval.width(), m_frameworkInval.height(),
+ rect.x(), rect.y(), rect.width(), rect.height());
}
TilesManager::instance()->getProfiler()->nextInval(rect, zoomManager()->currentScale());
}
@@ -271,10 +257,10 @@ void GLWebViewState::setViewport(const SkRect& viewport, float scale)
m_isViewportScrolling = m_viewport != viewport && SkRect::Intersects(m_viewport, viewport);
m_viewport = viewport;
- XLOG("New VIEWPORT %.2f - %.2f %.2f - %.2f (w: %2.f h: %.2f scale: %.2f currentScale: %.2f futureScale: %.2f)",
- m_viewport.fLeft, m_viewport.fTop, m_viewport.fRight, m_viewport.fBottom,
- m_viewport.width(), m_viewport.height(), scale,
- zoomManager()->currentScale(), zoomManager()->futureScale());
+ ALOGV("New VIEWPORT %.2f - %.2f %.2f - %.2f (w: %2.f h: %.2f scale: %.2f currentScale: %.2f futureScale: %.2f)",
+ m_viewport.fLeft, m_viewport.fTop, m_viewport.fRight, m_viewport.fBottom,
+ m_viewport.width(), m_viewport.height(), scale,
+ zoomManager()->currentScale(), zoomManager()->futureScale());
m_viewportTileBounds.set(
static_cast<int>(floorf(viewport.fLeft * invTileContentWidth)),
@@ -287,7 +273,7 @@ void GLWebViewState::setViewport(const SkRect& viewport, float scale)
void GLWebViewState::dumpMeasures()
{
for (int i = 0; i < m_timeCounter; i++) {
- XLOGC("%d delay: %d ms", m_totalTimeCounter + i,
+ ALOGD("%d delay: %d ms", m_totalTimeCounter + i,
static_cast<int>(m_delayTimes[i]*1000));
m_delayTimes[i] = 0;
}
@@ -355,12 +341,12 @@ double GLWebViewState::setupDrawing(const IntRect& viewRect, const SkRect& visib
// recreation caused by onTrimMemory in the framework.
ShaderProgram* shader = tilesManager->shader();
if (shader->needsInit()) {
- XLOGC("Reinit shader");
+ ALOGD("Reinit shader");
shader->initGLResources();
}
TransferQueue* transferQueue = tilesManager->transferQueue();
if (transferQueue->needsInit()) {
- XLOGC("Reinit transferQueue");
+ ALOGD("Reinit transferQueue");
transferQueue->initGLResources(TilesManager::tileWidth(),
TilesManager::tileHeight());
}
@@ -425,7 +411,7 @@ bool GLWebViewState::setLayersRenderingMode(TexturesResult& nbTexturesNeeded)
if (m_layersRenderingMode != layersRenderingMode) {
char* mode[] = { "kAllTextures", "kClippedTextures",
"kScrollableAndFixedLayers", "kFixedLayers", "kSingleSurfaceRendering" };
- XLOGC("Change from mode %s to %s -- We need textures: fixed: %d,"
+ ALOGD("Change from mode %s to %s -- We need textures: fixed: %d,"
" scrollable: %d, clipped: %d, full: %d, max textures: %d",
static_cast<char*>(mode[layersRenderingMode]),
static_cast<char*>(mode[m_layersRenderingMode]),
@@ -472,10 +458,6 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
scale);
tilesManager->incDrawGLCount();
-#ifdef DEBUG
- tilesManager->getTilesTracker()->clear();
-#endif
-
float viewWidth = (viewport.fRight - viewport.fLeft) * TILE_PREFETCH_RATIO;
float viewHeight = (viewport.fBottom - viewport.fTop) * TILE_PREFETCH_RATIO;
bool noPrefetch = tilesManager->useMinimalMemory() || !tilesManager->highEndGfx();
@@ -484,20 +466,20 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
m_expandedTileBoundsX = (useHorzPrefetch) ? TILE_PREFETCH_DISTANCE : 0;
m_expandedTileBoundsY = (useVertPrefetch) ? TILE_PREFETCH_DISTANCE : 0;
- XLOG("drawGL, rect(%d, %d, %d, %d), viewport(%.2f, %.2f, %.2f, %.2f)",
- rect.x(), rect.y(), rect.width(), rect.height(),
- viewport.fLeft, viewport.fTop, viewport.fRight, viewport.fBottom);
+ ALOGV("drawGL, rect(%d, %d, %d, %d), viewport(%.2f, %.2f, %.2f, %.2f)",
+ rect.x(), rect.y(), rect.width(), rect.height(),
+ viewport.fLeft, viewport.fTop, viewport.fRight, viewport.fBottom);
- XLOG("drawGL, invalRect(%d, %d, %d, %d), webViewRect(%d, %d, %d, %d)"
- "clip (%d, %d, %d, %d), scale %f",
- invalRect->x(), invalRect->y(), invalRect->width(), invalRect->height(),
- webViewRect.x(), webViewRect.y(), webViewRect.width(), webViewRect.height(),
- clip.x(), clip.y(), clip.width(), clip.height(), scale);
+ ALOGV("drawGL, invalRect(%d, %d, %d, %d), webViewRect(%d, %d, %d, %d)"
+ "clip (%d, %d, %d, %d), scale %f",
+ invalRect->x(), invalRect->y(), invalRect->width(), invalRect->height(),
+ webViewRect.x(), webViewRect.y(), webViewRect.width(), webViewRect.height(),
+ clip.x(), clip.y(), clip.width(), clip.height(), scale);
resetLayersDirtyArea();
if (scale < MIN_SCALE_WARNING || scale > MAX_SCALE_WARNING)
- XLOGC("WARNING, scale seems corrupted before update: %e", scale);
+ ALOGW("WARNING, scale seems corrupted before update: %e", scale);
// Here before we draw, update the BaseTile which has updated content.
// Inside this function, just do GPU blits from the transfer queue into
@@ -510,7 +492,7 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
bool ret = ImagesManager::instance()->prepareTextures(this);
if (scale < MIN_SCALE_WARNING || scale > MAX_SCALE_WARNING) {
- XLOGC("WARNING, scale seems corrupted after update: %e", scale);
+ ALOGW("WARNING, scale seems corrupted after update: %e", scale);
CRASH();
}
@@ -531,7 +513,7 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
resetFrameworkInval();
int nbTexturesForImages = ImagesManager::instance()->nbTextures();
- XLOG("*** We have %d textures for images, %d full, %d clipped, total %d / %d",
+ ALOGV("*** We have %d textures for images, %d full, %d clipped, total %d / %d",
nbTexturesForImages, nbTexturesNeeded.full, nbTexturesNeeded.clipped,
nbTexturesNeeded.full + nbTexturesForImages,
nbTexturesNeeded.clipped + nbTexturesForImages);
@@ -571,8 +553,8 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
invalRect->setWidth(inval.width());
invalRect->setHeight(inval.height());
- XLOG("invalRect(%d, %d, %d, %d)", inval.x(),
- inval.y(), inval.width(), inval.height());
+ ALOGV("invalRect(%d, %d, %d, %d)", inval.x(),
+ inval.y(), inval.width(), inval.height());
if (!invalRect->intersects(rect)) {
// invalidate is occurring offscreen, do full inval to guarantee redraw
@@ -592,10 +574,6 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
showFrameInfo(rect, *collectionsSwappedPtr);
-#ifdef DEBUG
- tilesManager->getTilesTracker()->showTrackTextures();
-#endif
-
return ret;
}
diff --git a/Source/WebCore/platform/graphics/android/GaneshContext.cpp b/Source/WebCore/platform/graphics/android/GaneshContext.cpp
index 80fe749..620fccf 100644
--- a/Source/WebCore/platform/graphics/android/GaneshContext.cpp
+++ b/Source/WebCore/platform/graphics/android/GaneshContext.cpp
@@ -23,30 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "GaneshContext"
+#define LOG_NDEBUG 1
#include "config.h"
#include "GaneshContext.h"
+
+#include "AndroidLog.h"
#include "GLUtils.h"
#include "android/native_window.h"
#if USE(ACCELERATED_COMPOSITING)
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GaneshContext", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
GaneshContext::GaneshContext()
@@ -87,8 +76,8 @@ SkDevice* GaneshContext::getDeviceForBaseTile(const TileRenderInfo& renderInfo)
// reset the Ganesh context to prevent rendering issues.
bool contextNeedsReset = false;
if (eglGetCurrentContext() != m_surfaceContext) {
- XLOG("Warning: EGLContext has Changed! %p, %p", m_surfaceContext,
- eglGetCurrentContext());
+ ALOGV("Warning: EGLContext has Changed! %p, %p",
+ m_surfaceContext, eglGetCurrentContext());
contextNeedsReset = true;
}
@@ -97,7 +86,7 @@ SkDevice* GaneshContext::getDeviceForBaseTile(const TileRenderInfo& renderInfo)
if (!m_surfaceContext) {
if(eglGetCurrentContext() != EGL_NO_CONTEXT) {
- XLOG("ERROR: should not have a context yet");
+ ALOGV("ERROR: should not have a context yet");
}
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@@ -150,12 +139,12 @@ SkDevice* GaneshContext::getDeviceForBaseTile(const TileRenderInfo& renderInfo)
tileQueue->m_eglSurface = eglCreateWindowSurface(display, m_surfaceConfig, anw, NULL);
GLUtils::checkEglError("eglCreateWindowSurface");
- XLOG("eglCreateWindowSurface");
+ ALOGV("eglCreateWindowSurface");
}
EGLBoolean returnValue = eglMakeCurrent(display, tileQueue->m_eglSurface, tileQueue->m_eglSurface, m_surfaceContext);
GLUtils::checkEglError("eglMakeCurrent", returnValue);
- XLOG("eglMakeCurrent");
+ ALOGV("eglMakeCurrent");
if (!m_baseTileDeviceSurface) {
@@ -172,7 +161,7 @@ SkDevice* GaneshContext::getDeviceForBaseTile(const TileRenderInfo& renderInfo)
m_baseTileDeviceSurface = new SkGpuDevice(grContext, renderTarget);
renderTarget->unref();
- XLOG("generated device %p", m_baseTileDeviceSurface);
+ ALOGV("generated device %p", m_baseTileDeviceSurface);
}
GLUtils::checkGlError("getDeviceForBaseTile");
diff --git a/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp b/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp
index c90ddb3..74b008c 100644
--- a/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp
@@ -23,34 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "GaneshRenderer"
+#define LOG_NDEBUG 1
#include "config.h"
#include "GaneshRenderer.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "GaneshContext.h"
#include "SkCanvas.h"
#include "SkGpuDevice.h"
#include "TilesManager.h"
-
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GaneshRenderer", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
static const String TAG_CREATE_FBO = "create_fbo";
@@ -90,7 +76,7 @@ void GaneshRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can
bool ready = tileQueue->readyForUpdate();
if (!ready) {
- XLOG("!ready");
+ ALOGV("!ready");
tileQueue->unlockQueue();
return;
}
@@ -101,9 +87,9 @@ void GaneshRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can
device = ganesh->getDeviceForBaseTile(renderInfo);
} else {
// TODO support arbitrary sizes for layers
- XLOG("ERROR: expected (%d,%d) actual (%d,%d)",
- TilesManager::tileWidth(), TilesManager::tileHeight(),
- renderInfo.tileSize.width(), renderInfo.tileSize.height());
+ ALOGV("ERROR: expected (%d,%d) actual (%d,%d)",
+ TilesManager::tileWidth(), TilesManager::tileHeight(),
+ renderInfo.tileSize.width(), renderInfo.tileSize.height());
}
if (renderInfo.measurePerf) {
@@ -132,7 +118,7 @@ void GaneshRenderer::renderingComplete(const TileRenderInfo& renderInfo, SkCanva
m_perfMon.start(TAG_UPDATE_TEXTURE);
}
- XLOG("rendered to tile (%d,%d)", renderInfo.x, renderInfo.y);
+ ALOGV("rendered to tile (%d,%d)", renderInfo.x, renderInfo.y);
GaneshContext::instance()->flush();
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 6bc2dc7..0acdc3b 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -14,12 +14,16 @@
* limitations under the License.
*/
+#define LOG_TAG "GraphicsLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "GraphicsLayerAndroid.h"
#if USE(ACCELERATED_COMPOSITING)
#include "AndroidAnimation.h"
+#include "AndroidLog.h"
#include "Animation.h"
#include "FloatRect.h"
#include "FixedPositioning.h"
@@ -44,23 +48,9 @@
#include "TransformationMatrix.h"
#include "TranslateTransformOperation.h"
-#include <cutils/log.h>
#include <wtf/CurrentTime.h>
#include <wtf/text/CString.h>
-#undef LOG
-#define LOG(...) android_printLog(ANDROID_LOG_DEBUG, "GraphicsLayer", __VA_ARGS__)
-#define MLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GraphicsLayer", __VA_ARGS__)
-#define TLOG(...) android_printLog(ANDROID_LOG_DEBUG, "GraphicsLayer", __VA_ARGS__)
-
-#undef LOG
-#define LOG(...)
-#undef MLOG
-#define MLOG(...)
-#undef TLOG
-#define TLOG(...)
-#undef LAYER_DEBUG
-
using namespace std;
static bool gPaused;
@@ -152,7 +142,7 @@ void GraphicsLayerAndroid::setName(const String& name)
NativeLayer GraphicsLayerAndroid::nativeLayer() const
{
- LOG("(%x) nativeLayer", this);
+ ALOGV("(%x) nativeLayer", this);
return 0;
}
@@ -171,7 +161,7 @@ void GraphicsLayerAndroid::addChild(GraphicsLayer* childLayer)
{
#ifndef NDEBUG
const String& name = childLayer->name();
- LOG("(%x) addChild: %x (%s)", this, childLayer, name.latin1().data());
+ ALOGV("(%x) addChild: %x (%s)", this, childLayer, name.latin1().data());
#endif
GraphicsLayer::addChild(childLayer);
m_needsSyncChildren = true;
@@ -180,7 +170,7 @@ void GraphicsLayerAndroid::addChild(GraphicsLayer* childLayer)
void GraphicsLayerAndroid::addChildAtIndex(GraphicsLayer* childLayer, int index)
{
- LOG("(%x) addChild %x AtIndex %d", this, childLayer, index);
+ ALOGV("(%x) addChild %x AtIndex %d", this, childLayer, index);
GraphicsLayer::addChildAtIndex(childLayer, index);
m_needsSyncChildren = true;
askForSync();
@@ -188,7 +178,7 @@ void GraphicsLayerAndroid::addChildAtIndex(GraphicsLayer* childLayer, int index)
void GraphicsLayerAndroid::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
{
- LOG("(%x) addChild %x Below %x", this, childLayer, sibling);
+ ALOGV("(%x) addChild %x Below %x", this, childLayer, sibling);
GraphicsLayer::addChildBelow(childLayer, sibling);
m_needsSyncChildren = true;
askForSync();
@@ -196,7 +186,7 @@ void GraphicsLayerAndroid::addChildBelow(GraphicsLayer* childLayer, GraphicsLaye
void GraphicsLayerAndroid::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer* sibling)
{
- LOG("(%x) addChild %x Above %x", this, childLayer, sibling);
+ ALOGV("(%x) addChild %x Above %x", this, childLayer, sibling);
GraphicsLayer::addChildAbove(childLayer, sibling);
m_needsSyncChildren = true;
askForSync();
@@ -204,7 +194,7 @@ void GraphicsLayerAndroid::addChildAbove(GraphicsLayer* childLayer, GraphicsLaye
bool GraphicsLayerAndroid::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
{
- LOG("(%x) replaceChild %x by %x", this, oldChild, newChild);
+ ALOGV("(%x) replaceChild %x by %x", this, oldChild, newChild);
bool ret = GraphicsLayer::replaceChild(oldChild, newChild);
if (ret) {
m_needsSyncChildren = true;
@@ -215,7 +205,7 @@ bool GraphicsLayerAndroid::replaceChild(GraphicsLayer* oldChild, GraphicsLayer*
void GraphicsLayerAndroid::removeFromParent()
{
- LOG("(%x) removeFromParent()", this);
+ ALOGV("(%x) removeFromParent()", this);
GraphicsLayerAndroid* parent = static_cast<GraphicsLayerAndroid*>(m_parent);
GraphicsLayer::removeFromParent();
// Update the parent's children.
@@ -296,7 +286,7 @@ void GraphicsLayerAndroid::setPosition(const FloatPoint& point)
GraphicsLayer::setPosition(point);
#ifdef LAYER_DEBUG_2
- LOG("(%x) setPosition(%.2f,%.2f) pos(%.2f, %.2f) anchor(%.2f,%.2f) size(%.2f, %.2f)",
+ ALOGV("(%x) setPosition(%.2f,%.2f) pos(%.2f, %.2f) anchor(%.2f,%.2f) size(%.2f, %.2f)",
this, point.x(), point.y(), m_position.x(), m_position.y(),
m_anchorPoint.x(), m_anchorPoint.y(), m_size.width(), m_size.height());
#endif
@@ -328,7 +318,7 @@ void GraphicsLayerAndroid::setSize(const FloatSize& size)
{
if (size == m_size)
return;
- MLOG("(%x) setSize (%.2f,%.2f)", this, size.width(), size.height());
+ ALOGV("(%x) setSize (%.2f,%.2f)", this, size.width(), size.height());
GraphicsLayer::setSize(size);
// If it is a media layer the size may have changed as a result of the media
@@ -339,8 +329,8 @@ void GraphicsLayerAndroid::setSize(const FloatSize& size)
RenderBox* box = layer->renderBox();
int outline = box->view()->maximalOutlineSize();
static_cast<MediaLayer*>(m_contentLayer)->setOutlineSize(outline);
- LOG("Media Outline: %d %p %p %p", outline, m_client, layer, box);
- LOG("Media Size: %g,%g", size.width(), size.height());
+ ALOGV("Media Outline: %d %p %p %p", outline, m_client, layer, box);
+ ALOGV("Media Size: %g,%g", size.width(), size.height());
}
m_contentLayer->setSize(size.width(), size.height());
@@ -372,7 +362,7 @@ void GraphicsLayerAndroid::setChildrenTransform(const TransformationMatrix& t)
{
if (t == m_childrenTransform)
return;
- LOG("(%x) setChildrenTransform", this);
+ ALOGV("(%x) setChildrenTransform", this);
GraphicsLayer::setChildrenTransform(t);
m_contentLayer->setChildrenTransform(t);
@@ -421,7 +411,7 @@ void GraphicsLayerAndroid::setBackgroundColor(const Color& color)
{
if (color == m_backgroundColor && m_backgroundColorSet)
return;
- LOG("(%x) setBackgroundColor", this);
+ ALOGV("(%x) setBackgroundColor", this);
GraphicsLayer::setBackgroundColor(color);
SkColor c = SkColorSetARGB(color.alpha(), color.red(), color.green(), color.blue());
m_contentLayer->setBackgroundColor(c);
@@ -434,7 +424,7 @@ void GraphicsLayerAndroid::clearBackgroundColor()
if (!m_backgroundColorSet)
return;
- LOG("(%x) clearBackgroundColor", this);
+ ALOGV("(%x) clearBackgroundColor", this);
GraphicsLayer::clearBackgroundColor();
askForSync();
}
@@ -443,7 +433,7 @@ void GraphicsLayerAndroid::setContentsOpaque(bool opaque)
{
if (opaque == m_contentsOpaque)
return;
- LOG("(%x) setContentsOpaque (%d)", this, opaque);
+ ALOGV("(%x) setContentsOpaque (%d)", this, opaque);
GraphicsLayer::setContentsOpaque(opaque);
m_haveContents = true;
askForSync();
@@ -451,13 +441,13 @@ void GraphicsLayerAndroid::setContentsOpaque(bool opaque)
void GraphicsLayerAndroid::setOpacity(float opacity)
{
- LOG("(%x) setOpacity: %.2f", this, opacity);
+ ALOGV("(%x) setOpacity: %.2f", this, opacity);
float clampedOpacity = max(0.0f, min(opacity, 1.0f));
if (clampedOpacity == m_opacity)
return;
- MLOG("(%x) setFinalOpacity: %.2f=>%.2f (%.2f)", this,
+ ALOGV("(%x) setFinalOpacity: %.2f=>%.2f (%.2f)", this,
opacity, clampedOpacity, m_opacity);
GraphicsLayer::setOpacity(clampedOpacity);
m_contentLayer->setOpacity(clampedOpacity);
@@ -466,7 +456,7 @@ void GraphicsLayerAndroid::setOpacity(float opacity)
void GraphicsLayerAndroid::setNeedsDisplay()
{
- LOG("(%x) setNeedsDisplay()", this);
+ ALOGV("(%x) setNeedsDisplay()", this);
FloatRect rect(0, 0, m_size.width(), m_size.height());
setNeedsDisplayInRect(rect);
}
@@ -590,8 +580,8 @@ void GraphicsLayerAndroid::updateScrollOffset() {
bool GraphicsLayerAndroid::repaint()
{
- LOG("(%x) repaint(), gPaused(%d) m_needsRepaint(%d) m_haveContents(%d) ",
- this, gPaused, m_needsRepaint, m_haveContents);
+ ALOGV("(%x) repaint(), gPaused(%d) m_needsRepaint(%d) m_haveContents(%d) ",
+ this, gPaused, m_needsRepaint, m_haveContents);
if (!gPaused && m_haveContents && m_needsRepaint && !m_image) {
// with SkPicture, we request the entire layer's content.
@@ -669,18 +659,18 @@ bool GraphicsLayerAndroid::repaint()
FrameView* view = layer->renderer()->frame()->view();
static_cast<IFrameContentLayerAndroid*>(m_contentLayer)->setScrollLimits(
m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight());
- LOG("setScrollLimits(%.2f, %.2f, w: %d h: %d) layer %d, frame scroll position is %d, %d",
+ ALOGV("setScrollLimits(%.2f, %.2f, w: %d h: %d) layer %d, frame scroll position is %d, %d",
m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight(),
m_contentLayer->uniqueId(), view->scrollX(), view->scrollY());
}
}
- LOG("(%x) repaint() on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!",
- this, m_size.width(), m_size.height(),
- m_contentLayer->getPosition().fX,
- m_contentLayer->getPosition().fY,
- m_contentLayer->getSize().width(),
- m_contentLayer->getSize().height());
+ ALOGV("(%x) repaint() on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!",
+ this, m_size.width(), m_size.height(),
+ m_contentLayer->getPosition().fX,
+ m_contentLayer->getPosition().fY,
+ m_contentLayer->getSize().width(),
+ m_contentLayer->getSize().height());
m_contentLayer->markAsDirty(m_dirtyRegion);
m_dirtyRegion.setEmpty();
@@ -734,8 +724,8 @@ void GraphicsLayerAndroid::setNeedsDisplayInRect(const FloatRect& rect)
// rect is in the render object coordinates
if (!m_image && !drawsContent()) {
- LOG("(%x) setNeedsDisplay(%.2f,%.2f,%.2f,%.2f) doesn't have content, bypass...",
- this, rect.x(), rect.y(), rect.width(), rect.height());
+ ALOGV("(%x) setNeedsDisplay(%.2f,%.2f,%.2f,%.2f) doesn't have content, bypass...",
+ this, rect.x(), rect.y(), rect.width(), rect.height());
return;
}
@@ -787,15 +777,15 @@ bool GraphicsLayerAndroid::createAnimationFromKeyframes(const KeyframeValueList&
const Animation* animation, const String& keyframesName, double beginTime)
{
bool isKeyframe = valueList.size() > 2;
- TLOG("createAnimationFromKeyframes(%d), name(%s) beginTime(%.2f)",
- isKeyframe, keyframesName.latin1().data(), beginTime);
+ ALOGV("createAnimationFromKeyframes(%d), name(%s) beginTime(%.2f)",
+ isKeyframe, keyframesName.latin1().data(), beginTime);
switch (valueList.property()) {
case AnimatedPropertyInvalid: break;
case AnimatedPropertyWebkitTransform: break;
case AnimatedPropertyBackgroundColor: break;
case AnimatedPropertyOpacity: {
- MLOG("ANIMATEDPROPERTYOPACITY");
+ ALOGV("ANIMATEDPROPERTYOPACITY");
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyOpacity);
for (unsigned int i = 0; i < valueList.size(); i++) {
@@ -836,8 +826,8 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe
const IntSize& boxSize)
{
ASSERT(valueList.property() == AnimatedPropertyWebkitTransform);
- TLOG("createTransformAnimationFromKeyframes, name(%s) beginTime(%.2f)",
- keyframesName.latin1().data(), beginTime);
+ ALOGV("createTransformAnimationFromKeyframes, name(%s) beginTime(%.2f)",
+ keyframesName.latin1().data(), beginTime);
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyWebkitTransform);
for (unsigned int i = 0; i < valueList.size(); i++) {
@@ -867,36 +857,36 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe
void GraphicsLayerAndroid::removeAnimationsForProperty(AnimatedPropertyID anID)
{
- TLOG("NRO removeAnimationsForProperty(%d)", anID);
+ ALOGV("NRO removeAnimationsForProperty(%d)", anID);
m_contentLayer->removeAnimationsForProperty(anID);
askForSync();
}
void GraphicsLayerAndroid::removeAnimationsForKeyframes(const String& keyframesName)
{
- TLOG("NRO removeAnimationsForKeyframes(%s)", keyframesName.latin1().data());
+ ALOGV("NRO removeAnimationsForKeyframes(%s)", keyframesName.latin1().data());
m_contentLayer->removeAnimationsForKeyframes(keyframesName);
askForSync();
}
void GraphicsLayerAndroid::pauseAnimation(const String& keyframesName)
{
- TLOG("NRO pauseAnimation(%s)", keyframesName.latin1().data());
+ ALOGV("NRO pauseAnimation(%s)", keyframesName.latin1().data());
}
void GraphicsLayerAndroid::suspendAnimations(double time)
{
- TLOG("NRO suspendAnimations(%.2f)", time);
+ ALOGV("NRO suspendAnimations(%.2f)", time);
}
void GraphicsLayerAndroid::resumeAnimations()
{
- TLOG("NRO resumeAnimations()");
+ ALOGV("NRO resumeAnimations()");
}
void GraphicsLayerAndroid::setContentsToImage(Image* image)
{
- TLOG("(%x) setContentsToImage", this, image);
+ ALOGV("(%x) setContentsToImage", this, image);
if (image && image != m_image) {
image->ref();
if (m_image)
@@ -950,7 +940,7 @@ void GraphicsLayerAndroid::setContentsToMedia(PlatformLayer* mediaLayer)
PlatformLayer* GraphicsLayerAndroid::platformLayer() const
{
- LOG("platformLayer");
+ ALOGV("platformLayer");
return m_contentLayer;
}
@@ -968,7 +958,7 @@ void GraphicsLayerAndroid::setZPosition(float position)
{
if (position == m_zPosition)
return;
- LOG("(%x) setZPosition: %.2f", this, position);
+ ALOGV("(%x) setZPosition: %.2f", this, position);
GraphicsLayer::setZPosition(position);
askForSync();
}
diff --git a/Source/WebCore/platform/graphics/android/IFrameContentLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/IFrameContentLayerAndroid.cpp
index 70b5c67..dadb13d 100644
--- a/Source/WebCore/platform/graphics/android/IFrameContentLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/IFrameContentLayerAndroid.cpp
@@ -1,12 +1,12 @@
+#define LOG_TAG "IFrameContentLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "IFrameContentLayerAndroid.h"
-#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "IFrameContentLayerAndroid", __VA_ARGS__)
+#if USE(ACCELERATED_COMPOSITING)
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/android/IFrameLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/IFrameLayerAndroid.cpp
index dfff91b..3532542 100644
--- a/Source/WebCore/platform/graphics/android/IFrameLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/IFrameLayerAndroid.cpp
@@ -1,16 +1,14 @@
+#define LOG_TAG "IFrameLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "IFrameLayerAndroid.h"
#if USE(ACCELERATED_COMPOSITING)
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
+#include "AndroidLog.h"
#include "DumpLayer.h"
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "IFrameLayerAndroid", __VA_ARGS__)
-
namespace WebCore {
IFrameLayerAndroid* IFrameLayerAndroid::updatePosition(SkRect viewport,
diff --git a/Source/WebCore/platform/graphics/android/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/ImageTexture.cpp
index 815a70a..e42d075 100644
--- a/Source/WebCore/platform/graphics/android/ImageTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/ImageTexture.cpp
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "ImageTexture"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ImageTexture.h"
+#include "AndroidLog.h"
#include "ImagesManager.h"
#include "LayerAndroid.h"
#include "SkDevice.h"
@@ -33,25 +37,6 @@
#include "TilesManager.h"
#include "TiledTexture.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ImageTexture", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "ImageTexture", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
// CRC computation adapted from Tools/DumpRenderTree/CyclicRedundancyCheck.cpp
@@ -166,7 +151,7 @@ int ImageTexture::nbTextures()
// a list of the clients layer, etc.)
IntRect visibleArea(0, 0, m_image->width(), m_image->height());
int nbTextures = m_texture->nbTextures(visibleArea, 1.0);
- XLOG("ImageTexture %p, %d x %d needs %d textures",
+ ALOGV("ImageTexture %p, %d x %d needs %d textures",
this, m_image->width(), m_image->height(),
nbTextures);
return nbTextures;
@@ -233,11 +218,11 @@ float ImageTexture::opacity()
bool ImageTexture::paint(BaseTile* tile, SkCanvas* canvas)
{
if (!m_picture) {
- XLOG("IT %p COULDNT PAINT, NO PICTURE", this);
+ ALOGV("IT %p COULDNT PAINT, NO PICTURE", this);
return false;
}
- XLOG("IT %p painting tile %d, %d with picture %p", this, tile->x(), tile->y(), m_picture);
+ ALOGV("IT %p painting tile %d, %d with picture %p", this, tile->x(), tile->y(), m_picture);
canvas->drawPicture(*m_picture);
return true;
diff --git a/Source/WebCore/platform/graphics/android/ImagesManager.cpp b/Source/WebCore/platform/graphics/android/ImagesManager.cpp
index 65c41d1..8452503 100644
--- a/Source/WebCore/platform/graphics/android/ImagesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/ImagesManager.cpp
@@ -23,33 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "ImagesManager"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ImagesManager.h"
+#include "AndroidLog.h"
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkRefCnt.h"
#include "ImageTexture.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ImagesManager", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "ImagesManager", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
ImagesManager* ImagesManager::instance()
diff --git a/Source/WebCore/platform/graphics/android/InspectorCanvas.cpp b/Source/WebCore/platform/graphics/android/InspectorCanvas.cpp
index 0137cec..f9edb74 100644
--- a/Source/WebCore/platform/graphics/android/InspectorCanvas.cpp
+++ b/Source/WebCore/platform/graphics/android/InspectorCanvas.cpp
@@ -23,31 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "InspectorCanvas"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "InspectorCanvas.h"
+#include "AndroidLog.h"
#include "SkPicture.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "InspectorCanvas", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "InspectorCanvas", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
-
namespace WebCore {
@@ -110,9 +94,9 @@ void InspectorCanvas::drawRect(const SkRect& rect, const SkPaint& paint)
// regular rect drawing path
setHasContent();
}
- XLOG("draw rect at %f %f, size %f %f, picture size %d %d",
- rect.fLeft, rect.fTop, rect.width(), rect.height(),
- m_picture->width(), m_picture->height());
+ ALOGV("draw rect at %f %f, size %f %f, picture size %d %d",
+ rect.fLeft, rect.fTop, rect.width(), rect.height(),
+ m_picture->width(), m_picture->height());
}
void InspectorCanvas::drawSprite(const SkBitmap& , int , int ,
const SkPaint* paint)
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
index 7886d7b..349df3a 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -1,8 +1,12 @@
+#define LOG_TAG "LayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "LayerAndroid.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "AndroidAnimation.h"
#include "ClassTracker.h"
#include "DrawExtra.h"
@@ -23,33 +27,15 @@
#include "TilesManager.h"
#include <wtf/CurrentTime.h>
+#include <wtf/text/CString.h>
#include <math.h>
-#define LAYER_DEBUG // Add diagonals for debugging
-#undef LAYER_DEBUG
-
#define DISABLE_LAYER_MERGE
#undef DISABLE_LAYER_MERGE
#define LAYER_GROUPING_DEBUG
#undef LAYER_GROUPING_DEBUG
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "LayerAndroid", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "LayerAndroid", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
static int gUniqueId;
@@ -379,9 +365,9 @@ IFrameLayerAndroid* LayerAndroid::updatePosition(SkRect viewport,
void LayerAndroid::updateLayerPositions(SkRect viewport, IFrameLayerAndroid* parentIframeLayer)
{
- XLOG("updating fixed positions, using viewport %fx%f - %fx%f",
- viewport.fLeft, viewport.fTop,
- viewport.width(), viewport.height());
+ ALOGV("updating fixed positions, using viewport %fx%f - %fx%f",
+ viewport.fLeft, viewport.fTop,
+ viewport.width(), viewport.height());
IFrameLayerAndroid* iframeLayer = updatePosition(viewport, parentIframeLayer);
@@ -436,9 +422,9 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM
// that layers (defined in content coordinates) will align to display/view pixels
float desiredContentX = round(m_drawTransform.m41() * scale) / scale;
float desiredContentY = round(m_drawTransform.m42() * scale) / scale;
- XLOG("fudging translation from %f, %f to %f, %f",
- m_drawTransform.m41(), m_drawTransform.m42(),
- desiredContentX, desiredContentY);
+ ALOGV("fudging translation from %f, %f to %f, %f",
+ m_drawTransform.m41(), m_drawTransform.m42(),
+ desiredContentX, desiredContentY);
m_drawTransform.setM41(desiredContentX);
m_drawTransform.setM42(desiredContentY);
}
@@ -566,9 +552,9 @@ void LayerAndroid::showLayer(int indent)
spaces[i] = ' ';
if (!indent) {
- XLOGC("\n\n--- LAYERS TREE ---");
+ ALOGD("\n\n--- LAYERS TREE ---");
IntRect documentViewport(TilesManager::instance()->shader()->documentViewport());
- XLOGC("documentViewport(%d, %d, %d, %d)",
+ ALOGD("documentViewport(%d, %d, %d, %d)",
documentViewport.x(), documentViewport.y(),
documentViewport.width(), documentViewport.height());
}
@@ -578,7 +564,7 @@ void LayerAndroid::showLayer(int indent)
IntRect visible = visibleArea();
IntRect clip(m_clippingRect.x(), m_clippingRect.y(),
m_clippingRect.width(), m_clippingRect.height());
- XLOGC("%s %s (%d) [%d:0x%x] - %s %s - area (%d, %d, %d, %d) - visible (%d, %d, %d, %d) "
+ ALOGD("%s %s (%d) [%d:0x%x] - %s %s - area (%d, %d, %d, %d) - visible (%d, %d, %d, %d) "
"clip (%d, %d, %d, %d) %s %s m_content(%x), pic w: %d h: %d",
spaces, subclassName().latin1().data(), subclassType(), uniqueId(), m_owningLayer,
needsTexture() ? "needs a texture" : "no texture",
@@ -712,7 +698,7 @@ void LayerAndroid::assignGroups(LayerMergeState* mergeState)
}
#ifdef LAYER_GROUPING_DEBUG
- XLOGC("%*slayer %p(%d) rl %p %s group %p, fixed %d, anim %d, intCom %d, haveClip %d scroll %d",
+ ALOGD("%*slayer %p(%d) rl %p %s group %p, fixed %d, anim %d, intCom %d, haveClip %d scroll %d",
4*mergeState->depth, "", this, m_uniqueId, m_owningLayer,
needNewGroup ? "NEW" : "joins", mergeState->currentLayerGroup,
m_isFixed, m_animations.size() != 0,
diff --git a/Source/WebCore/platform/graphics/android/LayerGroup.cpp b/Source/WebCore/platform/graphics/android/LayerGroup.cpp
index af45e41..f360919 100644
--- a/Source/WebCore/platform/graphics/android/LayerGroup.cpp
+++ b/Source/WebCore/platform/graphics/android/LayerGroup.cpp
@@ -23,33 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "LayerGroup"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "LayerGroup.h"
+#include "AndroidLog.h"
#include "ClassTracker.h"
#include "LayerAndroid.h"
#include "TiledTexture.h"
#include "TilesManager.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "LayerGroup", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "LayerGroup", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// LayerGroups with an area larger than 2048*2048 should never be unclipped
#define MAX_UNCLIPPED_AREA 4194304
@@ -88,8 +73,8 @@ bool LayerGroup::tryUpdateLayerGroup(LayerGroup* oldLayerGroup)
m_dualTiledTexture = oldLayerGroup->m_dualTiledTexture;
SkSafeRef(m_dualTiledTexture);
- XLOG("%p taking old DTT %p from group %p, nt %d",
- this, m_dualTiledTexture, oldLayerGroup, oldLayerGroup->needsTexture());
+ ALOGV("%p taking old DTT %p from group %p, nt %d",
+ this, m_dualTiledTexture, oldLayerGroup, oldLayerGroup->needsTexture());
if (!m_dualTiledTexture) {
// no DTT to inval, so don't worry about it.
@@ -148,10 +133,10 @@ void LayerGroup::addLayer(LayerAndroid* layer, const TransformationMatrix& trans
m_unclippedArea = rect;
} else
m_unclippedArea.unite(rect);
- XLOG("LG %p adding LA %p, size %d, %d %dx%d, now LG size %d,%d %dx%d",
- this, layer, rect.x(), rect.y(), rect.width(), rect.height(),
- m_unclippedArea.x(), m_unclippedArea.y(),
- m_unclippedArea.width(), m_unclippedArea.height());
+ ALOGV("LG %p adding LA %p, size %d, %d %dx%d, now LG size %d,%d %dx%d",
+ this, layer, rect.x(), rect.y(), rect.width(), rect.height(),
+ m_unclippedArea.x(), m_unclippedArea.y(),
+ m_unclippedArea.width(), m_unclippedArea.height());
}
}
@@ -174,8 +159,8 @@ IntRect LayerGroup::visibleArea()
void LayerGroup::prepareGL(bool layerTilesDisabled)
{
if (!m_dualTiledTexture) {
- XLOG("prepareGL on LG %p, no DTT, needsTexture? %d",
- this, m_dualTiledTexture, needsTexture());
+ ALOGV("prepareGL on LG %p, no DTT, needsTexture? %d",
+ this, m_dualTiledTexture, needsTexture());
if (needsTexture())
m_dualTiledTexture = new DualTiledTexture();
@@ -189,8 +174,8 @@ void LayerGroup::prepareGL(bool layerTilesDisabled)
bool allowZoom = hasText(); // only allow for scale > 1 if painting vectors
IntRect prepareArea = computePrepareArea();
- XLOG("prepareGL on LG %p with DTT %p, %d layers",
- this, m_dualTiledTexture, m_layers.size());
+ ALOGV("prepareGL on LG %p with DTT %p, %d layers",
+ this, m_dualTiledTexture, m_layers.size());
m_dualTiledTexture->prepareGL(getFirstLayer()->state(), allowZoom,
prepareArea, this);
}
@@ -207,7 +192,7 @@ bool LayerGroup::drawGL(bool layerTilesDisabled)
bool askRedraw = false;
if (m_dualTiledTexture && !layerTilesDisabled) {
- XLOG("drawGL on LG %p with DTT %p", this, m_dualTiledTexture);
+ ALOGV("drawGL on LG %p with DTT %p", this, m_dualTiledTexture);
IntRect drawArea = visibleArea();
askRedraw |= m_dualTiledTexture->drawGL(drawArea, opacity(), drawTransform());
diff --git a/Source/WebCore/platform/graphics/android/MediaLayer.cpp b/Source/WebCore/platform/graphics/android/MediaLayer.cpp
index c2f3630..de1db17 100644
--- a/Source/WebCore/platform/graphics/android/MediaLayer.cpp
+++ b/Source/WebCore/platform/graphics/android/MediaLayer.cpp
@@ -13,31 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define LOG_TAG "MediaLayer"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "MediaLayer.h"
+
+#include "AndroidLog.h"
#include "MediaTexture.h"
#include "TilesManager.h"
#if USE(ACCELERATED_COMPOSITING)
-#define LAYER_DEBUG
-#undef LAYER_DEBUG
-
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "MediaLayer", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
MediaLayer::MediaLayer(jobject webViewRef) : LayerAndroid((RenderLayer*) NULL)
@@ -47,7 +35,7 @@ MediaLayer::MediaLayer(jobject webViewRef) : LayerAndroid((RenderLayer*) NULL)
m_isCopy = false;
m_outlineSize = 0;
- XLOG("Creating Media Layer %p", this);
+ ALOGV("Creating Media Layer %p", this);
}
MediaLayer::MediaLayer(const MediaLayer& layer) : LayerAndroid(layer)
@@ -57,12 +45,12 @@ MediaLayer::MediaLayer(const MediaLayer& layer) : LayerAndroid(layer)
m_isCopy = true;
m_outlineSize = layer.m_outlineSize;
- XLOG("Creating Media Layer Copy %p -> %p", &layer, this);
+ ALOGV("Creating Media Layer Copy %p -> %p", &layer, this);
}
MediaLayer::~MediaLayer()
{
- XLOG("Deleting Media Layer");
+ ALOGV("Deleting Media Layer");
m_mediaTexture->decStrong(this);
}
diff --git a/Source/WebCore/platform/graphics/android/MediaListener.h b/Source/WebCore/platform/graphics/android/MediaListener.h
index 5fcbbb2..2dfc08b 100644
--- a/Source/WebCore/platform/graphics/android/MediaListener.h
+++ b/Source/WebCore/platform/graphics/android/MediaListener.h
@@ -26,21 +26,6 @@
#include "MediaTexture.h"
#include "WebCoreJni.h"
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "MediaListener", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
class MediaListener : public android::SurfaceTexture::FrameAvailableListener {
diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
index 2582a53..789ca03 100644
--- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
@@ -13,8 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define LOG_TAG "MediaTexture"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "MediaTexture.h"
+
+#include "AndroidLog.h"
#include "TilesManager.h"
#include "GLUtils.h"
#include "MediaListener.h"
@@ -24,28 +30,9 @@
#include <android/native_window.h>
#include <gui/SurfaceTexture.h>
#include <gui/SurfaceTextureClient.h>
-#include <wtf/CurrentTime.h>
#include <JNIUtility.h>
#include "WebCoreJni.h"
-#define LAYER_DEBUG
-#undef LAYER_DEBUG
-
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "MediaTexture", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// Limits the number of ANativeWindows that can be allocated for video playback.
// The limit is currently set to 2 as that is the current max number of
// simultaneous HW decodes that our OMX implementation allows. This forces the
@@ -171,7 +158,7 @@ void MediaTexture::draw(const TransformationMatrix& contentMatrix,
#ifdef DEBUG
if (!mediaBounds.contains(dimensions)) {
- XLOG("The video exceeds is parent's bounds.");
+ ALOGV("The video exceeds is parent's bounds.");
}
#endif // DEBUG
diff --git a/Source/WebCore/platform/graphics/android/PerformanceMonitor.cpp b/Source/WebCore/platform/graphics/android/PerformanceMonitor.cpp
index 902fa1e..ed6d046 100644
--- a/Source/WebCore/platform/graphics/android/PerformanceMonitor.cpp
+++ b/Source/WebCore/platform/graphics/android/PerformanceMonitor.cpp
@@ -23,14 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "PerformanceMonitor.h"
+#define LOG_TAG "PerformanceMonitor"
+#define LOG_NDEBUG 1
-#include <wtf/text/CString.h>
+#include "PerformanceMonitor.h"
-#include <wtf/CurrentTime.h>
-#include <cutils/log.h>
+#include "AndroidLog.h"
#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "PerformanceMonitor", __VA_ARGS__)
namespace WebCore {
@@ -90,14 +89,14 @@ void PerformanceMonitor::display(int limit)
PerfItem* item = it->second;
if (item->average_ms > limit) {
if (!shown) {
- XLOGC("=== DISPLAY MONITOR ====");
+ ALOGD("=== DISPLAY MONITOR ====");
shown = true;
}
- XLOGC("item %s took longer than %d ms: %.2f", it->first.latin1().data(), limit, item->average_ms);
+ ALOGD("item %s took longer than %d ms: %.2f", it->first.latin1().data(), limit, item->average_ms);
}
}
if (shown)
- XLOGC("=== END DISPLAY MONITOR ====");
+ ALOGD("=== END DISPLAY MONITOR ====");
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
index f52af60..44f2a7d 100644
--- a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
@@ -23,7 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "config.h"
#include "RasterRenderer.h"
@@ -36,23 +35,6 @@
#include "SkDevice.h"
#include "TilesManager.h"
-#include <wtf/text/CString.h>
-
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "RasterRenderer", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
static const String TAG_CREATE_BITMAP = "create_bitmap";
diff --git a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp
index dffab58..f28c31d 100644
--- a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp
@@ -1,3 +1,6 @@
+#define LOG_TAG "ScrollableLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ScrollableLayerAndroid.h"
@@ -5,10 +8,7 @@
#if USE(ACCELERATED_COMPOSITING)
-#include <wtf/CurrentTime.h>
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ScrollableLayerAndroid", __VA_ARGS__)
+#include "AndroidLog.h"
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
index 74a74e1..33829e3 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
@@ -23,35 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "ShaderProgram"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ShaderProgram.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "FloatPoint3D.h"
#include "GLUtils.h"
#include "TilesManager.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ShaderProgram", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "ShaderProgram", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
namespace WebCore {
@@ -172,7 +158,7 @@ GLuint ShaderProgram::loadShader(GLenum shaderType, const char* pSource)
char* buf = (char*) malloc(infoLen);
if (buf) {
glGetShaderInfoLog(shader, infoLen, 0, buf);
- XLOGC("could not compile shader %d:\n%s\n", shaderType, buf);
+ ALOGE("could not compile shader %d:\n%s\n", shaderType, buf);
free(buf);
}
glDeleteShader(shader);
@@ -187,13 +173,13 @@ GLint ShaderProgram::createProgram(const char* pVertexSource, const char* pFragm
{
GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
if (!vertexShader) {
- XLOGC("couldn't load the vertex shader!");
+ ALOGE("couldn't load the vertex shader!");
return -1;
}
GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
if (!pixelShader) {
- XLOGC("couldn't load the pixel shader!");
+ ALOGE("couldn't load the pixel shader!");
return -1;
}
@@ -213,7 +199,7 @@ GLint ShaderProgram::createProgram(const char* pVertexSource, const char* pFragm
char* buf = (char*) malloc(bufLength);
if (buf) {
glGetProgramInfoLog(program, bufLength, 0, buf);
- XLOGC("could not link program:\n%s\n", buf);
+ ALOGE("could not link program:\n%s\n", buf);
free(buf);
}
}
diff --git a/Source/WebCore/platform/graphics/android/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/SurfaceCollection.cpp
index 23abc06..a4c0ac8 100644
--- a/Source/WebCore/platform/graphics/android/SurfaceCollection.cpp
+++ b/Source/WebCore/platform/graphics/android/SurfaceCollection.cpp
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "SurfaceCollection"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "SurfaceCollection.h"
+#include "AndroidLog.h"
#include "BaseLayerAndroid.h"
#include "ClassTracker.h"
#include "LayerAndroid.h"
@@ -34,25 +38,6 @@
#include "ScrollableLayerAndroid.h"
#include "TilesManager.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "SurfaceCollection", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "SurfaceCollection", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +60,7 @@ SurfaceCollection::SurfaceCollection(BaseLayerAndroid* baseLayer)
m_baseLayer->updateLayerPositions(visibleRect);
// allocate groups for layers, merging where possible
- XLOG("new tree, allocating groups for tree %p", m_baseLayer);
+ ALOGV("new tree, allocating groups for tree %p", m_baseLayer);
LayerMergeState layerMergeState(&m_layerGroups);
m_compositedRoot->assignGroups(&layerMergeState);
@@ -174,7 +159,7 @@ bool SurfaceCollection::isReady()
for (unsigned int i = 0; i < m_layerGroups.size(); i++) {
if (!m_layerGroups[i]->isReady()) {
- XLOG("layer group %p isn't ready", m_layerGroups[i]);
+ ALOGV("layer group %p isn't ready", m_layerGroups[i]);
return false;
}
}
diff --git a/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
index 8ffcabd..633651d 100644
--- a/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
@@ -23,33 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "SurfaceCollectionManager"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "SurfaceCollectionManager.h"
+#include "AndroidLog.h"
#include "BaseLayerAndroid.h"
#include "LayerGroup.h"
#include "TilesManager.h"
#include "SurfaceCollection.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "SurfaceCollectionManager", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "SurfaceCollectionManager", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
SurfaceCollectionManager::SurfaceCollectionManager(GLWebViewState* state)
@@ -77,36 +62,36 @@ void SurfaceCollectionManager::swap()
android::Mutex::Autolock lock(m_paintSwapLock);
- XLOG("SWAPPING, D %p, P %p, Q %p",
- m_drawingCollection, m_paintingCollection, m_queuedCollection);
+ ALOGV("SWAPPING, D %p, P %p, Q %p",
+ m_drawingCollection, m_paintingCollection, m_queuedCollection);
// if we have a drawing collection, discard it since the painting collection is done
if (m_drawingCollection) {
- XLOG("destroying drawing collection %p", m_drawingCollection);
+ ALOGV("destroying drawing collection %p", m_drawingCollection);
SkSafeUnref(m_drawingCollection);
}
// painting collection becomes the drawing collection
- XLOG("drawing collection %p", m_paintingCollection);
+ ALOGV("drawing collection %p", m_paintingCollection);
m_paintingCollection->setIsDrawing(); // initialize animations
if (m_queuedCollection) {
// start painting with the queued collection
- XLOG("now painting collection %p", m_queuedCollection);
+ ALOGV("now painting collection %p", m_queuedCollection);
m_queuedCollection->setIsPainting(m_paintingCollection);
}
m_drawingCollection = m_paintingCollection;
m_paintingCollection = m_queuedCollection;
m_queuedCollection = 0;
- XLOG("SWAPPING COMPLETE, D %p, P %p, Q %p",
+ ALOGV("SWAPPING COMPLETE, D %p, P %p, Q %p",
m_drawingCollection, m_paintingCollection, m_queuedCollection);
}
// clear all of the content in the three collections held by the collection manager
void SurfaceCollectionManager::clearCollections()
{
- XLOG("SurfaceCollectionManager %p removing PS from state %p", this, m_state);
+ ALOGV("SurfaceCollectionManager %p removing PS from state %p", this, m_state);
SkSafeUnref(m_drawingCollection);
m_drawingCollection = 0;
@@ -122,9 +107,9 @@ void SurfaceCollectionManager::clearCollections()
bool SurfaceCollectionManager::updateWithSurfaceCollection(SurfaceCollection* newCollection,
bool brandNew)
{
- XLOG("updateWithSurfaceCollection - %p, has children %d, has animations %d",
- newCollection, newCollection->hasCompositedLayers(),
- newCollection->hasCompositedAnimations);
+ ALOGV("updateWithSurfaceCollection - %p, has children %d, has animations %d",
+ newCollection, newCollection->hasCompositedLayers(),
+ newCollection->hasCompositedAnimations());
// can't have a queued collection unless have a painting collection too
ASSERT(m_paintingCollection || !m_queuedCollection);
@@ -152,9 +137,9 @@ bool SurfaceCollectionManager::updateWithSurfaceCollection(SurfaceCollection* ne
TilesManager::instance()->incContentUpdates();
}
- XLOG("DISCARDING collection - %p, has children %d, has animations %d",
- newCollection, newCollection->hasCompositedLayers(),
- newCollection->hasCompositedAnimations());
+ ALOGV("DISCARDING collection - %p, has children %d, has animations %d",
+ newCollection, newCollection->hasCompositedLayers(),
+ newCollection->hasCompositedAnimations());
}
SkSafeUnref(m_queuedCollection);
m_queuedCollection = newCollection;
@@ -184,13 +169,13 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
{
m_fastSwapMode |= enterFastSwapMode;
- XLOG("drawGL, D %p, P %p, Q %p, fastSwap %d",
- m_drawingCollection, m_paintingCollection, m_queuedCollection, m_fastSwapMode);
+ ALOGV("drawGL, D %p, P %p, Q %p, fastSwap %d",
+ m_drawingCollection, m_paintingCollection, m_queuedCollection, m_fastSwapMode);
bool ret = false;
bool didCollectionSwap = false;
if (m_paintingCollection) {
- XLOG("preparing painting collection %p", m_paintingCollection);
+ ALOGV("preparing painting collection %p", m_paintingCollection);
m_paintingCollection->evaluateAnimations(currentTime);
@@ -198,7 +183,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
m_paintingCollection->computeTexturesAmount(texturesResultPtr);
if (!TilesManager::instance()->useDoubleBuffering() || m_paintingCollection->isReady()) {
- XLOG("have painting collection %p ready, swapping!", m_paintingCollection);
+ ALOGV("have painting collection %p ready, swapping!", m_paintingCollection);
didCollectionSwap = true;
TilesManager::instance()->incContentUpdates();
if (collectionsSwappedPtr)
@@ -208,7 +193,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
swap();
}
} else if (m_drawingCollection) {
- XLOG("preparing drawing collection %p", m_drawingCollection);
+ ALOGV("preparing drawing collection %p", m_drawingCollection);
m_drawingCollection->prepareGL(visibleRect, scale, currentTime);
m_drawingCollection->computeTexturesAmount(texturesResultPtr);
}
@@ -232,7 +217,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
}
m_drawingCollection->evaluateAnimations(currentTime);
- XLOG("drawing collection %p", m_drawingCollection);
+ ALOGV("drawing collection %p", m_drawingCollection);
ret |= m_drawingCollection->drawGL(visibleRect, scale);
} else {
// Dont have a drawing collection, draw white background
@@ -241,7 +226,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
}
if (m_paintingCollection) {
- XLOG("still have painting collection %p", m_paintingCollection);
+ ALOGV("still have painting collection %p", m_paintingCollection);
return true;
}
diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
index 4f7c1f0..81a404f 100644
--- a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
+++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
@@ -23,32 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TexturesGenerator"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TexturesGenerator.h"
#if USE(ACCELERATED_COMPOSITING)
-#include "BaseLayerAndroid.h"
+#include "AndroidLog.h"
#include "GLUtils.h"
#include "PaintTileOperation.h"
#include "TilesManager.h"
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TexturesGenerator", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
void TexturesGenerator::scheduleOperation(QueuedOperation* operation)
@@ -123,7 +110,7 @@ void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter, bool
status_t TexturesGenerator::readyToRun()
{
TilesManager::instance()->markGeneratorAsReady();
- XLOG("Thread ready to run");
+ ALOGV("Thread ready to run");
return NO_ERROR;
}
@@ -167,20 +154,21 @@ bool TexturesGenerator::threadLoop()
while (!mRequestedOperations.size())
mRequestedOperationsCond.wait(mRequestedOperationsLock);
- XLOG("threadLoop, got signal");
+ ALOGV("threadLoop, got signal");
mRequestedOperationsLock.unlock();
m_currentOperation = 0;
bool stop = false;
while (!stop) {
mRequestedOperationsLock.lock();
- XLOG("threadLoop, %d operations in the queue", mRequestedOperations.size());
+ ALOGV("threadLoop, %d operations in the queue", mRequestedOperations.size());
if (mRequestedOperations.size())
m_currentOperation = popNext();
mRequestedOperationsLock.unlock();
if (m_currentOperation) {
- XLOG("threadLoop, painting the request with priority %d", m_currentOperation->priority());
+ ALOGV("threadLoop, painting the request with priority %d",
+ m_currentOperation->priority());
m_currentOperation->run();
}
@@ -199,7 +187,7 @@ bool TexturesGenerator::threadLoop()
if (oldOperation)
delete oldOperation; // delete outside lock
}
- XLOG("threadLoop empty");
+ ALOGV("threadLoop empty");
return true;
}
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp
index 629b095..df740e7 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TiledPage"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TiledPage.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "GLUtils.h"
#include "IntRect.h"
#include "PaintTileOperation.h"
@@ -35,25 +39,6 @@
#include "SkPaintFlagsDrawFilter.h"
#include "TilesManager.h"
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "TiledPage", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TiledPage", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
using namespace android;
@@ -137,7 +122,8 @@ void TiledPage::invalidateRect(const IntRect& inval)
const int lastDirtyTileX = static_cast<int>(ceilf(inval.maxX() * invTileContentWidth));
const int lastDirtyTileY = static_cast<int>(ceilf(inval.maxY() * invTileContentHeight));
- XLOG("Marking X %d-%d and Y %d-%d dirty", firstDirtyTileX, lastDirtyTileX, firstDirtyTileY, lastDirtyTileY);
+ ALOGV("Marking X %d-%d and Y %d-%d dirty",
+ firstDirtyTileX, lastDirtyTileX, firstDirtyTileY, lastDirtyTileY);
#endif
// We defer marking the tile as dirty until the next time we need to prepare
// to draw.
@@ -171,14 +157,14 @@ void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y
}
if (!currentTile && availableTile) {
- XLOG("STEALING tile %d, %d (draw count %llu) for tile %d, %d",
+ ALOGV("STEALING tile %d, %d (draw count %llu) for tile %d, %d",
availableTile->x(), availableTile->y(), availableTile->drawCount(), x, y);
availableTile->discardTextures(); // don't wait for textures to be stolen
currentTile = availableTile;
}
if (!currentTile) {
- XLOG("ERROR: No tile available for tile %d %d", x, y);
+ ALOGV("ERROR: No tile available for tile %d %d", x, y);
}
if (currentTile) {
@@ -266,7 +252,7 @@ void TiledPage::prepare(bool goingDown, bool goingLeft, const SkIRect& tileBound
float numTiles = static_cast<float>(nbTilesHeight) * static_cast<float>(nbTilesWidth);
if (numTiles > TilesManager::getMaxTextureAllocation() || nbTilesHeight < 1 || nbTilesWidth < 1)
{
- XLOGC("ERROR: We don't have enough tiles for this page!"
+ ALOGE("ERROR: We don't have enough tiles for this page!"
" nbTilesHeight %d nbTilesWidth %d", nbTilesHeight, nbTilesWidth);
return;
}
@@ -292,7 +278,7 @@ bool TiledPage::hasMissingContent(const SkIRect& tileBounds)
bool TiledPage::isReady(const SkIRect& tileBounds)
{
int neededTiles = tileBounds.width() * tileBounds.height();
- XLOG("tiled page %p needs %d ready tiles", this, neededTiles);
+ ALOGV("tiled page %p needs %d ready tiles", this, neededTiles);
for (int j = 0; j < m_baseTileSize; j++) {
BaseTile& tile = m_baseTiles[j];
if (tileBounds.contains(tile.x(), tile.y())) {
@@ -300,7 +286,7 @@ bool TiledPage::isReady(const SkIRect& tileBounds)
neededTiles--;
}
}
- XLOG("tiled page %p still needs %d ready tiles", this, neededTiles);
+ ALOGV("tiled page %p still needs %d ready tiles", this, neededTiles);
return neededTiles == 0;
}
@@ -332,7 +318,7 @@ bool TiledPage::swapBuffersIfReady(const SkIRect& tileBounds, float scale)
swaps++;
}
- XLOG("%p greedy swapped %d textures, returning %d", this, swaps, fullSwap);
+ ALOGV("%p greedy swapped %d textures, returning %d", this, swaps, fullSwap);
return fullSwap;
}
diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
index 57d7683..3d36a1b 100644
--- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
@@ -23,34 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TiledTexture"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TiledTexture.h"
-#include "TilesManager.h"
-#include "TilesTracker.h"
-
+#include "AndroidLog.h"
#include "PaintTileOperation.h"
#include "SkCanvas.h"
#include "SkPicture.h"
+#include "TilesManager.h"
-#include <cutils/log.h>
#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "TiledTexture", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TiledTexture", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
namespace WebCore {
@@ -80,9 +65,9 @@ bool TiledTexture::isReady()
// in order to unblock the zooming process.
// FIXME: have a better system -- maybe keeping the last scale factor
// able to fully render everything
- XLOG("TT %p, ready %d, visible %d, texturesRemain %d",
- this, tilesAllReady, tilesVisible,
- TilesManager::instance()->layerTexturesRemain());
+ ALOGV("TT %p, ready %d, visible %d, texturesRemain %d",
+ this, tilesAllReady, tilesVisible,
+ TilesManager::instance()->layerTexturesRemain());
return !TilesManager::instance()->layerTexturesRemain()
|| !tilesVisible || tilesAllReady;
@@ -94,7 +79,7 @@ void TiledTexture::swapTiles()
for (unsigned int i = 0; i < m_tiles.size(); i++)
if (m_tiles[i]->swapTexturesIfNeeded())
swaps++;
- XLOG("TT %p swapping, swaps = %d", this, swaps);
+ ALOGV("TT %p swapping, swaps = %d", this, swaps);
}
IntRect TiledTexture::computeTilesArea(const IntRect& contentArea, float scale)
@@ -105,7 +90,7 @@ IntRect TiledTexture::computeTilesArea(const IntRect& contentArea, float scale)
ceilf(contentArea.width() * scale),
ceilf(contentArea.height() * scale));
- XLOG("TT %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height());
+ ALOGV("TT %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height());
if (area.width() == 0 && area.height() == 0) {
computedArea.setWidth(0);
@@ -133,13 +118,13 @@ void TiledTexture::prepareGL(GLWebViewState* state, float scale,
if (m_area.isEmpty())
return;
- XLOG("prepare TiledTexture %p with scale %.2f, prepareArea "
- " %d, %d - %d x %d, corresponding to %d, %d x - %d x %d tiles",
- this, scale,
- prepareArea.x(), prepareArea.y(),
- prepareArea.width(), prepareArea.height(),
- m_area.x(), m_area.y(),
- m_area.width(), m_area.height());
+ ALOGV("prepare TiledTexture %p with scale %.2f, prepareArea "
+ " %d, %d - %d x %d, corresponding to %d, %d x - %d x %d tiles",
+ this, scale,
+ prepareArea.x(), prepareArea.y(),
+ prepareArea.width(), prepareArea.height(),
+ m_area.x(), m_area.y(),
+ m_area.width(), m_area.height());
bool goingDown = m_prevTileY < m_area.y();
m_prevTileY = m_area.y();
@@ -169,8 +154,8 @@ void TiledTexture::prepareGL(GLWebViewState* state, float scale,
void TiledTexture::markAsDirty(const SkRegion& invalRegion)
{
- XLOG("TT %p markAsDirty, current region empty %d, new empty %d",
- this, m_dirtyRegion.isEmpty(), invalRegion.isEmpty());
+ ALOGV("TT %p markAsDirty, current region empty %d, new empty %d",
+ this, m_dirtyRegion.isEmpty(), invalRegion.isEmpty());
m_dirtyRegion.op(invalRegion, SkRegion::kUnion_Op);
}
@@ -182,7 +167,7 @@ void TiledTexture::prepareTile(int x, int y, TilePainter* painter)
m_tiles.append(tile);
}
- XLOG("preparing tile %p at %d, %d, painter is %p", tile, x, y, painter);
+ ALOGV("preparing tile %p at %d, %d, painter is %p", tile, x, y, painter);
tile->setContents(painter, x, y, m_scale);
// TODO: move below (which is largely the same for layers / tiled page) into
@@ -192,7 +177,7 @@ void TiledTexture::prepareTile(int x, int y, TilePainter* painter)
tile->reserveTexture();
if (tile->backTexture() && tile->isDirty() && !tile->isRepaintPending()) {
- XLOG("painting TT %p's tile %d %d for LG %p", this, x, y, painter);
+ ALOGV("painting TT %p's tile %d %d for LG %p", this, x, y, painter);
PaintTileOperation *operation = new PaintTileOperation(tile, painter);
TilesManager::instance()->scheduleOperation(operation);
}
@@ -228,18 +213,10 @@ int TiledTexture::nbTextures(IntRect& area, float scale)
bool TiledTexture::drawGL(const IntRect& visibleArea, float opacity,
const TransformationMatrix* transform)
{
-#ifdef DEBUG
- TilesManager::instance()->getTilesTracker()->trackLayer();
-#endif
-
m_area = computeTilesArea(visibleArea, m_scale);
if (m_area.width() == 0 || m_area.height() == 0)
return false;
-#ifdef DEBUG
- TilesManager::instance()->getTilesTracker()->trackVisibleLayer();
-#endif
-
float m_invScale = 1 / m_scale;
const float tileWidth = TilesManager::layerTileWidth() * m_invScale;
const float tileHeight = TilesManager::layerTileHeight() * m_invScale;
@@ -256,20 +233,16 @@ bool TiledTexture::drawGL(const IntRect& visibleArea, float opacity,
rect.fTop = tile->y() * tileHeight;
rect.fRight = rect.fLeft + tileWidth;
rect.fBottom = rect.fTop + tileHeight;
- XLOG("tile %p (layer tile: %d) %d,%d at scale %.2f vs %.2f [ready: %d] dirty: %d",
- tile, tile->isLayerTile(), tile->x(), tile->y(),
- tile->scale(), m_scale, tile->isTileReady(), tile->isDirty());
+ ALOGV("tile %p (layer tile: %d) %d,%d at scale %.2f vs %.2f [ready: %d] dirty: %d",
+ tile, tile->isLayerTile(), tile->x(), tile->y(),
+ tile->scale(), m_scale, tile->isTileReady(), tile->isDirty());
tile->drawGL(opacity, rect, m_scale, transform);
if (tile->frontTexture())
drawn++;
-#ifdef DEBUG
- TilesManager::instance()->getTilesTracker()->track(
- tile->isTileReady(), tile->backTexture());
-#endif
}
}
- XLOG("TT %p drew %d tiles, redraw due to notready %d, scale %f",
- this, drawn, askRedraw, m_scale);
+ ALOGV("TT %p drew %d tiles, redraw due to notready %d, scale %f",
+ this, drawn, askRedraw, m_scale);
// need to redraw if some visible tile wasn't ready
return askRedraw;
@@ -285,7 +258,7 @@ void TiledTexture::removeTiles()
void TiledTexture::discardTextures()
{
- XLOG("TT %p discarding textures", this);
+ ALOGV("TT %p discarding textures", this);
for (unsigned int i = 0; i < m_tiles.size(); i++)
m_tiles[i]->discardTextures();
}
@@ -342,9 +315,9 @@ void DualTiledTexture::prepareGL(GLWebViewState* state, bool allowZoom,
m_zooming = true;
}
- XLOG("Prepare DTT %p with scale %.2f, m_scale %.2f, futureScale: %.2f, zooming: %d, f %p, b %p",
- this, scale, m_scale, m_futureScale, m_zooming,
- m_frontTexture, m_backTexture);
+ ALOGV("Prepare DTT %p with scale %.2f, m_scale %.2f, futureScale: %.2f, zooming: %d, f %p, b %p",
+ this, scale, m_scale, m_futureScale, m_zooming,
+ m_frontTexture, m_backTexture);
if (m_scale > 0)
m_frontTexture->prepareGL(state, m_scale, m_preZoomPrepareArea, painter);
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index 5e9bf58..37a7301 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TilesManager"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TilesManager.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "BaseTile.h"
#include "SkCanvas.h"
#include "SkDevice.h"
@@ -36,26 +40,7 @@
#include <cutils/atomic.h>
#include <gui/SurfaceTexture.h>
#include <gui/SurfaceTextureClient.h>
-
-
-#include <cutils/log.h>
#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "TilesManager", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TilesManager", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
// Important: We need at least twice as many textures as is needed to cover
// one viewport, otherwise the allocation may stall.
@@ -111,7 +96,7 @@ TilesManager::TilesManager()
, m_lastTimeLayersUsed(0)
, m_hasLayerTextures(false)
{
- XLOG("TilesManager ctor");
+ ALOGV("TilesManager ctor");
m_textures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_availableTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_tilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
@@ -123,7 +108,7 @@ TilesManager::TilesManager()
void TilesManager::allocateTiles()
{
int nbTexturesToAllocate = m_maxTextureCount - m_textures.size();
- XLOG("%d tiles to allocate (%d textures planned)", nbTexturesToAllocate, m_maxTextureCount);
+ ALOGV("%d tiles to allocate (%d textures planned)", nbTexturesToAllocate, m_maxTextureCount);
int nbTexturesAllocated = 0;
for (int i = 0; i < nbTexturesToAllocate; i++) {
BaseTileTexture* texture = new BaseTileTexture(
@@ -138,8 +123,8 @@ void TilesManager::allocateTiles()
}
int nbLayersTexturesToAllocate = m_maxLayerTextureCount - m_tilesTextures.size();
- XLOG("%d layers tiles to allocate (%d textures planned)",
- nbLayersTexturesToAllocate, m_maxLayerTextureCount);
+ ALOGV("%d layers tiles to allocate (%d textures planned)",
+ nbLayersTexturesToAllocate, m_maxLayerTextureCount);
int nbLayersTexturesAllocated = 0;
for (int i = 0; i < nbLayersTexturesToAllocate; i++) {
BaseTileTexture* texture = new BaseTileTexture(
@@ -152,11 +137,11 @@ void TilesManager::allocateTiles()
m_tilesTextures.append(loadedTexture);
nbLayersTexturesAllocated++;
}
- XLOG("allocated %d textures for base (total: %d, %d Mb), %d textures for layers (total: %d, %d Mb)",
- nbTexturesAllocated, m_textures.size(),
- m_textures.size() * TILE_WIDTH * TILE_HEIGHT * 4 / 1024 / 1024,
- nbLayersTexturesAllocated, m_tilesTextures.size(),
- m_tilesTextures.size() * LAYER_TILE_WIDTH * LAYER_TILE_HEIGHT * 4 / 1024 / 1024);
+ ALOGV("allocated %d textures for base (total: %d, %d Mb), %d textures for layers (total: %d, %d Mb)",
+ nbTexturesAllocated, m_textures.size(),
+ m_textures.size() * TILE_WIDTH * TILE_HEIGHT * 4 / 1024 / 1024,
+ nbLayersTexturesAllocated, m_tilesTextures.size(),
+ m_tilesTextures.size() * LAYER_TILE_WIDTH * LAYER_TILE_HEIGHT * 4 / 1024 / 1024);
}
void TilesManager::discardTextures(bool allTextures, bool glTextures)
@@ -209,16 +194,16 @@ void TilesManager::discardTexturesVector(unsigned long long sparedDrawCount,
int remainedTextureNumber = textures.size();
int* countPtr = base ? &m_maxTextureCount : &m_maxLayerTextureCount;
if (remainedTextureNumber < *countPtr) {
- XLOG("reset maxTextureCount for %s tiles from %d to %d",
- base ? "base" : "layer", *countPtr, remainedTextureNumber);
+ ALOGV("reset maxTextureCount for %s tiles from %d to %d",
+ base ? "base" : "layer", *countPtr, remainedTextureNumber);
*countPtr = remainedTextureNumber;
}
}
- XLOG("Discarded %d %s textures (out of %d %s tiles)",
- dealloc, (deallocateGLTextures ? "gl" : ""),
- max, base ? "base" : "layer");
+ ALOGV("Discarded %d %s textures (out of %d %s tiles)",
+ dealloc, (deallocateGLTextures ? "gl" : ""),
+ max, base ? "base" : "layer");
}
void TilesManager::gatherTexturesNumbers(int* nbTextures, int* nbAllocatedTextures,
@@ -241,7 +226,7 @@ void TilesManager::gatherTexturesNumbers(int* nbTextures, int* nbAllocatedTextur
void TilesManager::printTextures()
{
#ifdef DEBUG
- XLOG("++++++");
+ ALOGV("++++++");
for (unsigned int i = 0; i < m_textures.size(); i++) {
BaseTileTexture* texture = m_textures[i];
BaseTile* o = 0;
@@ -253,11 +238,11 @@ void TilesManager::printTextures()
x = o->x();
y = o->y();
}
- XLOG("[%d] texture %x owner: %x (%d, %d) page: %x scale: %.2f",
- i, texture,
- o, x, y, o ? o->page() : 0, o ? o->scale() : 0);
+ ALOGV("[%d] texture %x owner: %x (%d, %d) page: %x scale: %.2f",
+ i, texture,
+ o, x, y, o ? o->page() : 0, o ? o->scale() : 0);
}
- XLOG("------");
+ ALOGV("------");
#endif // DEBUG
}
@@ -280,8 +265,8 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
// Sanity check that the tile does not already own a texture
if (owner->backTexture() && owner->backTexture()->owner() == owner) {
- XLOG("same owner (%d, %d), getAvailableBackTexture(%x) => texture %x",
- owner->x(), owner->y(), owner, owner->backTexture());
+ ALOGV("same owner (%d, %d), getAvailableBackTexture(%x) => texture %x",
+ owner->x(), owner->y(), owner, owner->backTexture());
if (owner->isLayerTile())
m_availableTilesTextures.remove(m_availableTilesTextures.find(owner->backTexture()));
else
@@ -335,11 +320,11 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
if (previousOwner) {
previousOwner->removeTexture(farthestTexture);
- XLOG("%s texture %p stolen from tile %d, %d for %d, %d, drawCount was %llu (now %llu)",
- owner->isLayerTile() ? "LAYER" : "BASE",
- farthestTexture, previousOwner->x(), previousOwner->y(),
- owner->x(), owner->y(),
- oldestDrawCount, getDrawGLCount());
+ ALOGV("%s texture %p stolen from tile %d, %d for %d, %d, drawCount was %llu (now %llu)",
+ owner->isLayerTile() ? "LAYER" : "BASE",
+ farthestTexture, previousOwner->x(), previousOwner->y(),
+ owner->x(), owner->y(),
+ oldestDrawCount, getDrawGLCount());
}
availableTexturePool->remove(availableTexturePool->find(farthestTexture));
@@ -354,7 +339,7 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
}
}
- XLOG("Couldn't find an available texture for %s tile %x (%d, %d) out of %d available",
+ ALOGV("Couldn't find an available texture for %s tile %x (%d, %d) out of %d available",
owner->isLayerTile() ? "LAYER" : "BASE",
owner, owner->x(), owner->y(), max);
#ifdef DEBUG
@@ -387,7 +372,7 @@ int TilesManager::maxLayerTextureCount()
void TilesManager::setMaxTextureCount(int max)
{
- XLOG("setMaxTextureCount: %d (current: %d, total:%d)",
+ ALOGV("setMaxTextureCount: %d (current: %d, total:%d)",
max, m_maxTextureCount, MAX_TEXTURE_ALLOCATION);
if (m_maxTextureCount == MAX_TEXTURE_ALLOCATION ||
max <= m_maxTextureCount)
@@ -405,7 +390,7 @@ void TilesManager::setMaxTextureCount(int max)
void TilesManager::setMaxLayerTextureCount(int max)
{
- XLOG("setMaxLayerTextureCount: %d (current: %d, total:%d)",
+ ALOGV("setMaxLayerTextureCount: %d (current: %d, total:%d)",
max, m_maxLayerTextureCount, MAX_TEXTURE_ALLOCATION);
if (!max && m_hasLayerTextures) {
double secondsSinceLayersUsed = WTF::currentTime() - m_lastTimeLayersUsed;
@@ -466,10 +451,10 @@ TilesManager* TilesManager::instance()
{
if (!gInstance) {
gInstance = new TilesManager();
- XLOG("instance(), new gInstance is %x", gInstance);
- XLOG("Waiting for the generator...");
+ ALOGV("instance(), new gInstance is %x", gInstance);
+ ALOGV("Waiting for the generator...");
gInstance->waitForGenerator();
- XLOG("Generator ready!");
+ ALOGV("Generator ready!");
}
return gInstance;
}
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h
index a0ed9e7..aafdfb6 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.h
+++ b/Source/WebCore/platform/graphics/android/TilesManager.h
@@ -37,7 +37,6 @@
#include "TexturesGenerator.h"
#include "TiledPage.h"
#include "TilesProfiler.h"
-#include "TilesTracker.h"
#include "TransferQueue.h"
#include "VideoLayerManager.h"
#include <utils/threads.h>
@@ -134,11 +133,6 @@ public:
return &m_profiler;
}
- TilesTracker* getTilesTracker()
- {
- return &m_tilesTracker;
- }
-
bool invertedScreen()
{
return m_invertedScreen;
@@ -250,7 +244,6 @@ private:
VideoLayerManager m_videoLayerManager;
TilesProfiler m_profiler;
- TilesTracker m_tilesTracker;
unsigned long long m_drawGLCount;
double m_lastTimeLayersUsed;
bool m_hasLayerTextures;
diff --git a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp
index 0271ee3..a113514 100644
--- a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp
@@ -23,29 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TilesProfiler"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TilesProfiler.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "TilesManager.h"
#include <wtf/CurrentTime.h>
-#ifdef DEBUG
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TilesProfiler", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// Hard limit on amount of frames (and thus memory) profiling can take
#define MAX_PROF_FRAMES 400
#define INVAL_CODE -2
@@ -63,19 +52,19 @@ void TilesProfiler::start()
m_badTiles = 0;
m_records.clear();
m_time = currentTimeMS();
- XLOG("initializing tileprofiling");
+ ALOGV("initializing tileprofiling");
}
float TilesProfiler::stop()
{
m_enabled = false;
- XLOG("completed tile profiling, observed %d frames", m_records.size());
+ ALOGV("completed tile profiling, observed %d frames", m_records.size());
return (1.0 * m_goodTiles) / (m_goodTiles + m_badTiles);
}
void TilesProfiler::clear()
{
- XLOG("clearing tile profiling of its %d frames", m_records.size());
+ ALOGV("clearing tile profiling of its %d frames", m_records.size());
m_records.clear();
}
@@ -90,8 +79,8 @@ void TilesProfiler::nextFrame(int left, int top, int right, int bottom, float sc
#ifdef DEBUG
if (m_records.size() != 0) {
- XLOG("completed tile profiling frame, observed %d tiles. %f ms since last",
- m_records[0].size(), timeDelta);
+ ALOGD("completed tile profiling frame, observed %d tiles. %f ms since last",
+ m_records[0].size(), timeDelta);
}
#endif // DEBUG
@@ -123,7 +112,7 @@ void TilesProfiler::nextTile(BaseTile& tile, float scale, bool inView)
m_records.last().append(TileProfileRecord(
left, top, right, bottom,
scale, isReady, (int)tile.drawCount()));
- XLOG("adding tile %d %d %d %d, scale %f", left, top, right, bottom, scale);
+ ALOGV("adding tile %d %d %d %d, scale %f", left, top, right, bottom, scale);
}
void TilesProfiler::nextInval(const IntRect& rect, float scale)
@@ -134,8 +123,8 @@ void TilesProfiler::nextInval(const IntRect& rect, float scale)
m_records.last().append(TileProfileRecord(
rect.x(), rect.y(),
rect.maxX(), rect.maxY(), scale, false, INVAL_CODE));
- XLOG("adding inval region %d %d %d %d, scale %f", rect.x(), rect.y(),
- rect.maxX(), rect.maxY(), scale);
+ ALOGV("adding inval region %d %d %d %d, scale %f", rect.x(), rect.y(),
+ rect.maxX(), rect.maxY(), scale);
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/TilesTracker.h b/Source/WebCore/platform/graphics/android/TilesTracker.h
deleted file mode 100644
index 202d072..0000000
--- a/Source/WebCore/platform/graphics/android/TilesTracker.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER OR
- * 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 TilesTracker_h
-#define TilesTracker_h
-
-#if USE(ACCELERATED_COMPOSITING)
-
-#include <cutils/log.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TilesTracker", __VA_ARGS__)
-
-namespace WebCore {
-
-class TilesTracker {
-public:
- TilesTracker() {
- clear();
- }
-
- void track(bool ready, bool haveTexture) {
- m_nbTextures++;
- if (ready)
- m_nbTexturesReady++;
- else
- m_nbTexturesNotReady++;
- if (haveTexture)
- m_nbTexturesUsed++;
- }
-
- void clear() {
- m_nbLayers = 0;
- m_nbVisibleLayers = 0;
- m_nbTextures = 0;
- m_nbTexturesReady = 0;
- m_nbTexturesNotReady = 0;
- m_nbTexturesUsed = 0;
- }
-
- void trackLayer() { m_nbLayers++; }
- void trackVisibleLayer() { m_nbVisibleLayers++; }
-
- void showTrackTextures() {
- XLOG("We had %d/%d layers needing %d textures, we had %d, %d were ready, %d were not",
- m_nbLayers, m_nbVisibleLayers, m_nbTextures, m_nbTexturesUsed, m_nbTexturesReady, m_nbTexturesNotReady);
- }
-
-private:
- int m_nbLayers;
- int m_nbVisibleLayers;
- int m_nbTextures;
- int m_nbTexturesReady;
- int m_nbTexturesNotReady;
- int m_nbTexturesUsed;
-};
-
-} // namespace WebCore
-
-#endif // USE(ACCELERATED_COMPOSITING)
-#endif // TilesTracker_h
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
index 0002c2c..d5ffc1a 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "TransferQueue"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "TransferQueue.h"
#if USE(ACCELERATED_COMPOSITING)
+#include "AndroidLog.h"
#include "BaseTile.h"
#include "GLUtils.h"
#include "TilesManager.h"
@@ -35,22 +39,6 @@
#include <gui/SurfaceTexture.h>
#include <gui/SurfaceTextureClient.h>
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "TransferQueue", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TransferQueue", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// For simple webView usage, MINIMAL_SIZE is recommended for memory saving.
// In browser case, EFFICIENT_SIZE is preferred.
#define MINIMAL_SIZE 1
@@ -142,13 +130,13 @@ bool TransferQueue::checkObsolete(const TileTransferData* data)
{
BaseTile* baseTilePtr = data->savedBaseTilePtr;
if (!baseTilePtr) {
- XLOG("Invalid savedBaseTilePtr , such that the tile is obsolete");
+ ALOGV("Invalid savedBaseTilePtr , such that the tile is obsolete");
return true;
}
BaseTileTexture* baseTileTexture = baseTilePtr->backTexture();
if (!baseTileTexture) {
- XLOG("Invalid baseTileTexture , such that the tile is obsolete");
+ ALOGV("Invalid baseTileTexture , such that the tile is obsolete");
return true;
}
@@ -208,7 +196,7 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex,
destTex->getSize().height());
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
- XLOG("Error: glCheckFramebufferStatus failed");
+ ALOGV("Error: glCheckFramebufferStatus failed");
glBindFramebuffer(GL_FRAMEBUFFER, 0);
return;
}
@@ -347,7 +335,7 @@ void TransferQueue::updatePureColorTiles()
}
} else if (data->status == emptyItem || data->status == pendingDiscard) {
// The queue should be clear instead of setting to different status.
- XLOG("Warning: Don't expect an emptyItem here.");
+ ALOGV("Warning: Don't expect an emptyItem here.");
}
}
m_pureColorTileQueue.clear();
@@ -387,12 +375,12 @@ void TransferQueue::updateDirtyBaseTiles()
if (m_transferQueue[index].uploadType == GpuUpload) {
status_t result = m_sharedSurfaceTexture->updateTexImage();
if (result != OK)
- XLOGC("unexpected error: updateTexImage return %d", result);
+ ALOGE("unexpected error: updateTexImage return %d", result);
}
m_transferQueue[index].savedBaseTilePtr = 0;
m_transferQueue[index].status = emptyItem;
if (obsoleteBaseTile) {
- XLOG("Warning: the texture is obsolete for this baseTile");
+ ALOGV("Warning: the texture is obsolete for this baseTile");
index = (index + 1) % m_transferQueueSize;
continue;
}
@@ -419,11 +407,10 @@ void TransferQueue::updateDirtyBaseTiles()
destTexture->setPure(false);
destTexture->transferComplete();
- XLOG("Blit tile x, y %d %d with dest texture %p to destTexture->m_ownTextureId %d",
- m_transferQueue[index].tileInfo.m_x,
- m_transferQueue[index].tileInfo.m_y,
- destTexture,
- destTexture->m_ownTextureId);
+ ALOGV("Blit tile x, y %d %d with dest texture %p to destTexture->m_ownTextureId %d",
+ m_transferQueue[index].savedBaseTilePtr,
+ destTexture,
+ destTexture->m_ownTextureId);
}
index = (index + 1) % m_transferQueueSize;
}
@@ -464,14 +451,14 @@ bool TransferQueue::tryUpdateQueueWithBitmap(const TileRenderInfo* renderInfo,
bool ready = readyForUpdate();
TextureUploadType currentUploadType = m_currentUploadType;
if (!ready) {
- XLOG("Quit bitmap update: not ready! for tile x y %d %d",
- renderInfo->x, renderInfo->y);
+ ALOGV("Quit bitmap update: not ready! for tile x y %d %d",
+ renderInfo->x, renderInfo->y);
return false;
}
if (currentUploadType == GpuUpload) {
// a) Dequeue the Surface Texture and write into the buffer
if (!m_ANW.get()) {
- XLOG("ERROR: ANW is null");
+ ALOGV("ERROR: ANW is null");
return false;
}
@@ -507,8 +494,8 @@ bool TransferQueue::tryUpdateQueueWithBitmap(const TileRenderInfo* renderInfo,
// b) After update the Surface Texture, now udpate the transfer queue info.
addItemInTransferQueue(renderInfo, currentUploadType, &bitmap);
- XLOG("Bitmap updated x, y %d %d, baseTile %p",
- renderInfo->x, renderInfo->y, renderInfo->baseTile);
+ ALOGV("Bitmap updated x, y %d %d, baseTile %p",
+ renderInfo->x, renderInfo->y, renderInfo->baseTile);
return true;
}
@@ -555,7 +542,7 @@ void TransferQueue::addItemInTransferQueue(const TileRenderInfo* renderInfo,
int index = m_transferQueueIndex;
if (m_transferQueue[index].savedBaseTilePtr
|| m_transferQueue[index].status != emptyItem) {
- XLOG("ERROR update a tile which is dirty already @ index %d", index);
+ ALOGV("ERROR update a tile which is dirty already @ index %d", index);
}
TileTransferData* data = &m_transferQueue[index];
@@ -583,7 +570,7 @@ void TransferQueue::setTextureUploadType(TextureUploadType type)
setPendingDiscard();
m_currentUploadType = type;
- XLOGC("Now we set the upload to %s", m_currentUploadType == GpuUpload ? "GpuUpload" : "CpuUpload");
+ ALOGD("Now we set the upload to %s", m_currentUploadType == GpuUpload ? "GpuUpload" : "CpuUpload");
}
// Note: this need to be called within the lock and on the UI thread.
@@ -600,7 +587,7 @@ void TransferQueue::cleanupPendingDiscard()
if (m_transferQueue[index].uploadType == GpuUpload) {
status_t result = m_sharedSurfaceTexture->updateTexImage();
if (result != OK)
- XLOGC("unexpected error: updateTexImage return %d", result);
+ ALOGE("unexpected error: updateTexImage return %d", result);
}
// since tiles in the queue may be from another webview, remove
@@ -611,7 +598,7 @@ void TransferQueue::cleanupPendingDiscard()
// since tile destruction removes textures on the UI thread, the
// texture->owner ptr guarantees the tile is valid
tile->discardBackTexture();
- XLOG("transfer queue discarded tile %p, removed texture", tile);
+ ALOGV("transfer queue discarded tile %p, removed texture", tile);
}
m_transferQueue[index].savedBaseTilePtr = 0;
diff --git a/Source/WebCore/platform/graphics/android/VideoLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/VideoLayerAndroid.cpp
index e48d36c..756bf28 100644
--- a/Source/WebCore/platform/graphics/android/VideoLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/VideoLayerAndroid.cpp
@@ -23,32 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "VideoLayerAndroid"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "VideoLayerAndroid.h"
+#include "AndroidLog.h"
#include "TilesManager.h"
#include <GLES2/gl2.h>
-#include <cutils/log.h>
#include <gui/SurfaceTexture.h>
-#include <wtf/text/CString.h>
#if USE(ACCELERATED_COMPOSITING)
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "VideoLayerAndroid", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "VideoLayerAndroid", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
double VideoLayerAndroid::m_rotateDegree = 0;
diff --git a/Source/WebCore/platform/graphics/android/VideoLayerManager.cpp b/Source/WebCore/platform/graphics/android/VideoLayerManager.cpp
index f957aed..6501f98 100644
--- a/Source/WebCore/platform/graphics/android/VideoLayerManager.cpp
+++ b/Source/WebCore/platform/graphics/android/VideoLayerManager.cpp
@@ -23,32 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "VideoLayerManager"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "VideoLayerManager.h"
+#include "AndroidLog.h"
#include "RenderSkinMediaButton.h"
#include "SkCanvas.h"
-#include <cutils/log.h>
#include <wtf/CurrentTime.h>
-#include <wtf/text/CString.h>
#if USE(ACCELERATED_COMPOSITING)
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "VideoLayerManager", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "VideoLayerManager", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
// The animation of the play/pause icon will last for PLAY_PAUSE_ICON_SHOW_TIME
// seconds.
#define PLAY_PAUSE_ICON_SHOW_TIME 1
@@ -112,7 +99,7 @@ GLuint VideoLayerManager::createTextureFromImage(int buttonType)
void VideoLayerManager::initGLResourcesIfNeeded()
{
if (!m_createdTexture) {
- XLOGC("Reinit GLResource for VideoLayer");
+ ALOGD("Reinit GLResource for VideoLayer");
initGLResources();
}
}
@@ -155,7 +142,7 @@ void VideoLayerManager::cleanupGLResources()
// The map include every video has been played, so their textureId can
// be deleted already, like hitting onTrimMemory multiple times.
if (it->second->textureId) {
- XLOG("delete texture from the map %d", it->second->textureId);
+ ALOGV("delete texture from the map %d", it->second->textureId);
glDeleteTextures(1, &it->second->textureId);
// Set the textureID to 0 to show the video icon.
it->second->textureId = 0;
@@ -230,7 +217,7 @@ void VideoLayerManager::registerTexture(const int layerId, const GLuint textureI
pInfo->iconState = Registered;
m_videoLayerInfoMap.add(layerId, pInfo);
- XLOG("GL texture %d regisered for layerId %d", textureId, layerId);
+ ALOGV("GL texture %d regisered for layerId %d", textureId, layerId);
return;
}
@@ -272,7 +259,7 @@ void VideoLayerManager::updateMatrix(const int layerId, const GLfloat* matrix)
return;
memcpy(pInfo->surfaceMatrix, matrix, sizeof(pInfo->surfaceMatrix));
} else {
- XLOG("Error: should not reach here, the layerId %d should exist!", layerId);
+ ALOGV("Error: should not reach here, the layerId %d should exist!", layerId);
ASSERT(false);
}
return;
@@ -290,10 +277,10 @@ bool VideoLayerManager::recycleTextureMem()
InfoIterator end = m_videoLayerInfoMap.end();
#ifdef DEBUG
- XLOG("VideoLayerManager::recycleTextureMem m_videoLayerInfoMap contains");
+ ALOGV("VideoLayerManager::recycleTextureMem m_videoLayerInfoMap contains");
for (InfoIterator it = m_videoLayerInfoMap.begin(); it != end; ++it)
- XLOG(" layerId %d, textureId %d, videoSize %d, timeStamp %d ",
- it->first, it->second->textureId, it->second->videoSize, it->second->timeStamp);
+ ALOGV(" layerId %d, textureId %d, videoSize %d, timeStamp %d ",
+ it->first, it->second->textureId, it->second->videoSize, it->second->timeStamp);
#endif
for (InfoIterator it = m_videoLayerInfoMap.begin(); it != end; ++it) {
if (it->second->timeStamp < oldestTimeStamp) {
@@ -325,7 +312,7 @@ void VideoLayerManager::deleteUnusedTextures()
if (textureName) {
textureNames[index] = textureName;
index++;
- XLOG("GL texture %d will be deleted", textureName);
+ ALOGV("GL texture %d will be deleted", textureName);
}
}
glDeleteTextures(size, textureNames);
diff --git a/Source/WebCore/platform/graphics/android/ZoomManager.cpp b/Source/WebCore/platform/graphics/android/ZoomManager.cpp
index 2cf9f06..35100ae 100644
--- a/Source/WebCore/platform/graphics/android/ZoomManager.cpp
+++ b/Source/WebCore/platform/graphics/android/ZoomManager.cpp
@@ -23,33 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define LOG_TAG "ZoomManager"
+#define LOG_NDEBUG 1
+
#include "config.h"
#include "ZoomManager.h"
+#include "AndroidLog.h"
#include "GLWebViewState.h"
#if USE(ACCELERATED_COMPOSITING)
-#include <wtf/CurrentTime.h>
-
-#include <cutils/log.h>
-#include <wtf/text/CString.h>
-
-#undef XLOGC
-#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "ZoomManager", __VA_ARGS__)
-
-#ifdef DEBUG
-
-#undef XLOG
-#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "ZoomManager", __VA_ARGS__)
-
-#else
-
-#undef XLOG
-#define XLOG(...)
-
-#endif // DEBUG
-
namespace WebCore {
using namespace android;