• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/webkit


Commit MetaInfo

Revisiónd13df54b67ff2373e79cf6c70bd2369e556ec9c0 (tree)
Tiempo2012-01-05 06:46:46
AutorBart Sears <bsears@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "Fix crash with composited layers - DO NOT MERGE" into ics-mr1

Cambiar Resumen

Diferencia incremental

--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -963,11 +963,31 @@ void GraphicsLayerAndroid::syncMask()
963963 }
964964 }
965965
966-void GraphicsLayerAndroid::syncCompositingState()
966+void GraphicsLayerAndroid::gatherRootLayers(Vector<const RenderLayer*>& list)
967967 {
968- for (unsigned int i = 0; i < m_children.size(); i++)
969- m_children[i]->syncCompositingState();
968+ RenderLayer* renderLayer = renderLayerFromClient(m_client);
969+ if (renderLayer) {
970+ const RenderLayer* rootLayer = renderLayer->root();
971+ bool found = false;
972+ for (unsigned int i = 0; i < list.size(); i++) {
973+ const RenderLayer* current = list[i];
974+ if (current == rootLayer) {
975+ found = true;
976+ break;
977+ }
978+ }
979+ if (!found)
980+ list.append(rootLayer);
981+ }
970982
983+ for (unsigned int i = 0; i < m_children.size(); i++) {
984+ GraphicsLayerAndroid* layer = static_cast<GraphicsLayerAndroid*>(m_children[i]);
985+ layer->gatherRootLayers(list);
986+ }
987+}
988+
989+void GraphicsLayerAndroid::syncCompositingStateForThisLayerOnly()
990+{
971991 updateScrollingLayers();
972992 updateFixedPosition();
973993 syncChildren();
@@ -977,6 +997,14 @@ void GraphicsLayerAndroid::syncCompositingState()
977997 repaint();
978998 }
979999
1000+void GraphicsLayerAndroid::syncCompositingState()
1001+{
1002+ for (unsigned int i = 0; i < m_children.size(); i++)
1003+ m_children[i]->syncCompositingState();
1004+
1005+ syncCompositingStateForThisLayerOnly();
1006+}
1007+
9801008 void GraphicsLayerAndroid::notifyClientAnimationStarted()
9811009 {
9821010 for (unsigned int i = 0; i < m_children.size(); i++)
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
@@ -116,7 +116,9 @@ public:
116116
117117 virtual void setZPosition(float);
118118
119+ void gatherRootLayers(Vector<const RenderLayer*>&);
119120 virtual void syncCompositingState();
121+ virtual void syncCompositingStateForThisLayerOnly();
120122 void notifyClientAnimationStarted();
121123
122124 LayerAndroid* contentLayer() { return m_contentLayer; }
--- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -37,12 +37,15 @@
3737 #include "FrameLoader.h"
3838 #include "FrameView.h"
3939 #include "Geolocation.h"
40+#include "GraphicsLayerAndroid.h"
4041 #include "HTMLMediaElement.h"
4142 #include "HTMLNames.h"
4243 #include "Icon.h"
4344 #include "LayerAndroid.h"
4445 #include "Page.h"
4546 #include "PopupMenuAndroid.h"
47+#include "RenderLayer.h"
48+#include "RenderLayerCompositor.h"
4649 #include "ScriptController.h"
4750 #include "SearchPopupMenuAndroid.h"
4851 #include "WebCoreFrameBridge.h"
@@ -64,7 +67,21 @@ static unsigned long long tryToReclaimDatabaseQuota(SecurityOrigin* originNeedin
6467 WebCore::GraphicsLayer* ChromeClientAndroid::layersSync()
6568 {
6669 if (m_rootGraphicsLayer && m_needsLayerSync && m_webFrame) {
67- if (FrameView* frameView = m_webFrame->page()->mainFrame()->view())
70+ // We may have more than one frame, so let's first update all of them
71+ // (webkit may want to update the GraphicsLayer tree, and we do *not* want
72+ // to find this out when we are painting, as it means we could be summarily
73+ // deallocated while painting...)
74+ GraphicsLayerAndroid* rootLayer = static_cast<GraphicsLayerAndroid*>(m_rootGraphicsLayer);
75+ Vector<const RenderLayer*> listRootLayers;
76+ rootLayer->gatherRootLayers(listRootLayers);
77+
78+ for (unsigned int i = 0; i < listRootLayers.size(); i++) {
79+ RenderLayer* layer = const_cast<RenderLayer*>(listRootLayers[i]);
80+ layer->compositor()->updateCompositingLayers();
81+ }
82+
83+ Frame* frame = m_webFrame->page()->mainFrame();
84+ if (FrameView* frameView = frame->view())
6885 frameView->syncCompositingStateIncludingSubframes();
6986 }
7087 m_needsLayerSync = false;