diff options
Diffstat (limited to 'WebCore/platform/graphics/android')
3 files changed, 55 insertions, 36 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.h b/WebCore/platform/graphics/android/BaseLayerAndroid.h new file mode 100644 index 0000000..b9e2f4e --- /dev/null +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.h @@ -0,0 +1,49 @@ +/* + * Copyright 2010, 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 BASELAYERANDROID_H_ +#define BASELAYERANDROID_H_ + +#include "PictureSet.h" +#include "SkLayer.h" + +namespace WebCore { + +class BaseLayerAndroid : public SkLayer { + +public: + BaseLayerAndroid() { } + virtual ~BaseLayerAndroid() { } + + void setContent(const android::PictureSet& src) { m_content.set(src); } + android::PictureSet* content() { return &m_content; } + +private: + android::PictureSet m_content; +}; + +} // namespace WebCore + +#endif /* BASELAYERANDROID_H_ */ diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 1fb36ec..6faee17 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -407,33 +407,6 @@ void GraphicsLayerAndroid::setNeedsDisplay() setNeedsDisplayInRect(rect); } -void GraphicsLayerAndroid::setFrame(Frame* f) -{ - m_frame = f; -} - -void GraphicsLayerAndroid::sendImmediateRepaint() -{ - LOG("(%x) sendImmediateRepaint()", this); - GraphicsLayerAndroid* rootGraphicsLayer = this; - - while (rootGraphicsLayer->parent()) - rootGraphicsLayer = static_cast<GraphicsLayerAndroid*>(rootGraphicsLayer->parent()); - - if (rootGraphicsLayer->m_frame - && rootGraphicsLayer->m_frame->view()) { - LayerAndroid* rootLayer = new LayerAndroid(true); - LayerAndroid* copyLayer = new LayerAndroid(*m_contentLayer); - rootLayer->addChild(copyLayer); - copyLayer->unref(); - TLOG("(%x) sendImmediateRepaint, copy the layer, (%.2f,%.2f => %.2f,%.2f)", - this, m_contentLayer->getSize().width(), m_contentLayer->getSize().height(), - copyLayer->getSize().width(), copyLayer->getSize().height()); - PlatformBridge::setUIRootLayer(m_frame->view(), rootLayer); - PlatformBridge::immediateRepaint(m_frame->view()); - } -} - bool GraphicsLayerAndroid::repaint() { LOG("(%x) repaint(), gPaused(%d) m_needsRepaint(%d) m_haveContents(%d) ", diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.h b/WebCore/platform/graphics/android/GraphicsLayerAndroid.h index b72877b..54a035b 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.h +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.h @@ -108,22 +108,21 @@ public: virtual void setZPosition(float); - void askForSync(); - void syncPositionState(); - void needsSyncChildren(); - void syncChildren(); - void syncMask(); virtual void syncCompositingState(); - void setFrame(Frame*); void notifyClientAnimationStarted(); - void sendImmediateRepaint(); LayerAndroid* contentLayer() { return m_contentLayer; } static int instancesCount(); private: + void askForSync(); + void syncPositionState(); + void needsSyncChildren(); + void syncChildren(); + void syncMask(); + void updateFixedPosition(); // with SkPicture, we always repaint the entire layer's content. @@ -146,8 +145,6 @@ private: FloatPoint m_currentPosition; - RefPtr<Frame> m_frame; - Vector<FloatRect> m_invalidatedRects; LayerAndroid* m_contentLayer; |
