diff options
Diffstat (limited to 'WebCore/platform')
| -rw-r--r-- | WebCore/platform/android/PlatformBridge.h | 6 | ||||
| -rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 14 | ||||
| -rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 25 |
3 files changed, 35 insertions, 10 deletions
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h index 0918fe9..45da526 100644 --- a/WebCore/platform/android/PlatformBridge.h +++ b/WebCore/platform/android/PlatformBridge.h @@ -81,6 +81,10 @@ class NPObject; namespace WebCore { +#if USE(ACCELERATED_COMPOSITING) +class LayerAndroid; +#endif + class FrameView; class Widget; @@ -121,7 +125,7 @@ public: #if USE(ACCELERATED_COMPOSITING) // Those methods are used by the layers system - static void setRootLayer(const FrameView* view, int layer); + static void setUIRootLayer(const FrameView* view, const LayerAndroid* layer); static void immediateRepaint(const FrameView* view); #endif // USE(ACCELERATED_COMPOSITING) diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index ee7c888..be275a8 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -418,9 +418,9 @@ void GraphicsLayerAndroid::sendImmediateRepaint() && rootGraphicsLayer->m_frame->view()) { LayerAndroid* copyLayer = new LayerAndroid(*m_contentLayer); TLOG("(%x) sendImmediateRepaint, copy the layer, (%.2f,%.2f => %.2f,%.2f)", - this, m_contentLayer->size().width(), m_contentLayer->size().height(), - copyLayer->size().width(), copyLayer->size().height()); - PlatformBridge::setRootLayer(m_frame->view(), (int)copyLayer); + this, m_contentLayer->getSize().width(), m_contentLayer->getSize().height(), + copyLayer->getSize().width(), copyLayer->getSize().height()); + PlatformBridge::setUIRootLayer(m_frame->view(), copyLayer); PlatformBridge::immediateRepaint(m_frame->view()); } } @@ -457,10 +457,10 @@ bool GraphicsLayerAndroid::repaint(const FloatRect& rect) TLOG("(%x) repaint(%.2f,%.2f,%.2f,%.2f) on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!", this, rect.x(), rect.y(), rect.width(), rect.height(), m_size.width(), m_size.height(), - m_contentLayer->position().fX, - m_contentLayer->position().fY, - m_contentLayer->size().width(), - m_contentLayer->size().height()); + m_contentLayer->getPosition().fX, + m_contentLayer->getPosition().fY, + m_contentLayer->getSize().width(), + m_contentLayer->getSize().height()); } return true; } diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 9d60efd..2dc8a05 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -300,10 +300,10 @@ void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity) { canvas->clipRect(r); } - if (!prepareContext()) + if (!m_haveImage && !m_drawsContent && !m_isRootLayer) return; - if (!m_haveImage && !m_drawsContent && !m_isRootLayer) + if (!prepareContext()) return; // we just have this save/restore for opacity... @@ -314,6 +314,20 @@ void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity) { canvas->setDrawFilter(new OpacityDrawFilter(canvasOpacity)); m_recordingPicture->draw(canvas); + +#ifdef LAYER_DEBUG + float w = getSize().width(); + float h = getSize().height(); + SkPaint paint; + paint.setARGB(128, 255, 0, 0); + canvas->drawLine(0, 0, w, h, paint); + canvas->drawLine(0, h, w, 0, paint); + paint.setARGB(128, 0, 255, 0); + canvas->drawLine(0, 0, 0, h, paint); + canvas->drawLine(0, h, w, h, paint); + canvas->drawLine(w, h, w, 0, paint); + canvas->drawLine(w, 0, 0, 0, paint); +#endif } SkPicture* LayerAndroid::recordContext() @@ -393,6 +407,12 @@ void writeIntVal(FILE* file, int indentLevel, const char* str, int value) fprintf(file, "%s = %d;\n", str, value); } +void writeHexVal(FILE* file, int indentLevel, const char* str, int value) +{ + writeIndent(file, indentLevel); + fprintf(file, "%s = %x;\n", str, value); +} + void writeFloatVal(FILE* file, int indentLevel, const char* str, float value) { writeIndent(file, indentLevel); @@ -422,6 +442,7 @@ void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const { writeln(file, indentLevel, "{"); + writeHexVal(file, indentLevel + 1, "layer", (int)this); writeIntVal(file, indentLevel + 1, "haveContents", m_haveContents); writeIntVal(file, indentLevel + 1, "drawsContent", m_drawsContent); writeIntVal(file, indentLevel + 1, "haveImage", m_haveImage); |
