diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-03-06 17:10:29 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-03-07 15:10:47 -0800 |
commit | 47b8a953ab1b71113b605fd84489f63938bd7dd7 (patch) | |
tree | 88647e8ac2b779805910a0464a57870f7344457a /Source/WebKit | |
parent | bb78287b9586253a7ae7d5d8b1a7a0326643c7ce (diff) | |
download | external_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.zip external_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.tar.gz external_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.tar.bz2 |
Refactor LayerAndroid to add iframe subclasses
Change-Id: Ia3810e83a2d919ff5fa37b8fcd92e6cbbb63d569
Diffstat (limited to 'Source/WebKit')
-rw-r--r-- | Source/WebKit/android/jni/ViewStateSerializer.cpp | 25 | ||||
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 2 |
2 files changed, 19 insertions, 8 deletions
diff --git a/Source/WebKit/android/jni/ViewStateSerializer.cpp b/Source/WebKit/android/jni/ViewStateSerializer.cpp index 78a3543..d2fe900 100644 --- a/Source/WebKit/android/jni/ViewStateSerializer.cpp +++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp @@ -29,6 +29,8 @@ #include "CreateJavaOutputStreamAdaptor.h" #include "FixedLayerAndroid.h" #include "ImagesManager.h" +#include "IFrameContentLayerAndroid.h" +#include "IFrameLayerAndroid.h" #include "Layer.h" #include "LayerAndroid.h" #include "PictureSet.h" @@ -279,7 +281,7 @@ void serializeLayer(LayerAndroid* layer, SkWStream* stream) stream->writeBool(layer->m_haveClip); stream->writeBool(layer->isFixed()); stream->writeBool(layer->m_backgroundColorSet); - stream->writeBool(layer->m_isIframe); + stream->writeBool(layer->isIFrame()); // With the current LayerAndroid hierarchy, LayerAndroid doesn't have // those fields anymore. Let's keep the current serialization format for @@ -385,14 +387,26 @@ LayerAndroid* deserializeLayer(int version, SkStream* stream) // Keep the legacy serialization/deserialization format... bool isFixed = stream->readBool(); + + layer->m_backgroundColorSet = stream->readBool(); + + bool isIframe = stream->readBool(); + // If we are a scrollable layer android, we are an iframe content + if (isIframe && type == LTScrollableLayerAndroid) { + IFrameContentLayerAndroid* iframeContent = new IFrameContentLayerAndroid(*layer); + layer->unref(); + layer = iframeContent; + } else if (isIframe) { // otherwise we are just the iframe (we use it to compute offset) + IFrameLayerAndroid* iframe = new IFrameLayerAndroid(*layer); + layer->unref(); + layer = iframe; + } + if (isFixed) { FixedLayerAndroid* fixedLayer = new FixedLayerAndroid(*layer); layer->unref(); layer = fixedLayer; - layer->m_backgroundColorSet = stream->readBool(); - layer->m_isIframe = stream->readBool(); - fixedLayer->m_fixedLeft = readSkLength(stream); fixedLayer->m_fixedTop = readSkLength(stream); fixedLayer->m_fixedRight = readSkLength(stream); @@ -405,9 +419,6 @@ LayerAndroid* deserializeLayer(int version, SkStream* stream) fixedLayer->m_renderLayerPos.setX(stream->readS32()); fixedLayer->m_renderLayerPos.setY(stream->readS32()); } else { - layer->m_backgroundColorSet = stream->readBool(); - layer->m_isIframe = stream->readBool(); - // Not a fixed element, bypass the values in the stream readSkLength(stream); // fixedLeft readSkLength(stream); // fixedTop diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 830ef4e..8b7acc5 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -313,7 +313,7 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, DrawExtras extras, bool spli if (compositeLayer) { // call this to be sure we've adjusted for any scrolling or animations // before we actually draw - compositeLayer->updateFixedLayersPositions(m_visibleRect); + compositeLayer->updateLayerPositions(m_visibleRect); compositeLayer->updatePositions(); // We have to set the canvas' matrix on the base layer // (to have fixed layers work as intended) |