Diff
Modified: trunk/Source/WebCore/ChangeLog (154700 => 154701)
--- trunk/Source/WebCore/ChangeLog 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/ChangeLog 2013-08-27 18:32:57 UTC (rev 154701)
@@ -1,3 +1,49 @@
+2013-08-27 Jacky Jiang <[email protected]>
+
+ [BlackBerry] Rotate device from landscape to portrait during youtube streaming will cause device screen flash with video list page
+ https://bugs.webkit.org/show_bug.cgi?id=120364
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Arvid Nilsson.
+
+ JIRA 461232
+ When rotating device from landscape mode to portrait mode, we updated
+ texture contents based on landscape mode front visibility and back
+ visibility on WebKit thread at the very beginning and the landscape mode
+ tiles wouldn't be able to cover the portrait mode screen which resulted
+ in the screen flash.
+ It's hard to compute front visibility information on WebKit thread because
+ it doesn't know where the layers will be on the screen. Therefore, the
+ front visibility won't be updated until the first time we draw textures
+ on compositing thread.
+ The patch traverses through LayerWebKitThread and LayerCompositingThread
+ and discards back visibility and front visibility respectively if there
+ is a pending orientation. In this way, we can pick up layerTilerPrefillRect
+ as visibleRect instead of the visibleRect from the stale visibilities
+ and add more tiles for uncovered screen when updating texture contents
+ on WebKit thread.
+ The patch also fixes a bug that we prune tiles based on the stale
+ m_requiredTextureSize in pruneTextures(). We should prune tiles based
+ on the updated pendingTextureSize instead.
+
+ * platform/graphics/blackberry/LayerCompositingThread.cpp:
+ (WebCore::LayerCompositingThread::discardFrontVisibility):
+ * platform/graphics/blackberry/LayerCompositingThread.h:
+ * platform/graphics/blackberry/LayerCompositingThreadClient.h:
+ (WebCore::LayerCompositingThreadClient::discardFrontVisibility):
+ * platform/graphics/blackberry/LayerRenderer.cpp:
+ (WebCore::LayerRenderer::discardFrontVisibility):
+ * platform/graphics/blackberry/LayerRenderer.h:
+ * platform/graphics/blackberry/LayerTiler.cpp:
+ (WebCore::LayerTiler::discardFrontVisibility):
+ (WebCore::LayerTiler::processTextureJob):
+ (WebCore::LayerTiler::pruneTextures):
+ (WebCore::LayerTiler::discardBackVisibility):
+ * platform/graphics/blackberry/LayerTiler.h:
+ * platform/graphics/blackberry/LayerWebKitThread.cpp:
+ (WebCore::LayerWebKitThread::discardBackVisibility):
+ * platform/graphics/blackberry/LayerWebKitThread.h:
+
2013-08-27 Antti Koivisto <[email protected]>
Better mutation and event assertions for descendant iterators
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -567,6 +567,12 @@
m_override.clear();
}
+void LayerCompositingThread::discardFrontVisibility()
+{
+ if (m_client)
+ m_client->discardFrontVisibility();
}
+}
+
#endif // USE(ACCELERATED_COMPOSITING)
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -230,6 +230,8 @@
LayerOverride* override();
void clearOverride();
+ void discardFrontVisibility();
+
#if ENABLE(CSS_FILTERS)
bool filterOperationsChanged() const { return m_filterOperationsChanged; }
void setFilterOperationsChanged(bool changed) { m_filterOperationsChanged = changed; }
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThreadClient.h (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThreadClient.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThreadClient.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -54,6 +54,8 @@
// Unlike the other methods here, this one will be called on the WebKit thread
virtual void scheduleCommit() { }
+
+ virtual void discardFrontVisibility() { }
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -593,6 +593,15 @@
glDrawArrays(GL_LINE_LOOP, 0, transformedBounds.size());
}
+void LayerRenderer::discardFrontVisibility()
+{
+ if (m_hardwareCompositing) {
+ makeContextCurrent();
+ for (LayerSet::iterator iter = m_layers.begin(); iter != m_layers.end(); ++iter)
+ (*iter)->discardFrontVisibility();
+ }
+}
+
// Draws a debug border around the layer's bounds.
void LayerRenderer::drawDebugBorder(LayerCompositingThread* layer)
{
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.h (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -136,6 +136,8 @@
void drawDebugBorder(const Vector<FloatPoint>&, const Color&, float borderWidth);
+ void discardFrontVisibility();
+
static GLuint loadShader(GLenum type, const char* shaderSource);
static GLuint loadShaderProgram(const char* vertexShaderSource, const char* fragmentShaderSource);
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -348,6 +348,12 @@
m_pendingTextureJobs.clear();
}
+void LayerTiler::discardFrontVisibility()
+{
+ delete m_frontVisibility;
+ m_frontVisibility = 0;
+}
+
LayerVisibility* LayerTiler::swapFrontVisibility(LayerVisibility* visibility)
{
return reinterpret_cast<LayerVisibility*>(_smp_xchg(reinterpret_cast<unsigned*>(&m_frontVisibility), reinterpret_cast<unsigned>(visibility)));
@@ -406,7 +412,7 @@
if (job.m_type == TextureJob::ResizeContents) {
IntSize pendingTextureSize = job.m_dirtyRect.size();
if (pendingTextureSize.width() < m_requiredTextureSize.width() || pendingTextureSize.height() < m_requiredTextureSize.height())
- pruneTextures();
+ pruneTextures(pendingTextureSize);
m_requiredTextureSize = pendingTextureSize;
return;
@@ -633,7 +639,7 @@
m_requiredTextureSize = IntSize();
}
-void LayerTiler::pruneTextures()
+void LayerTiler::pruneTextures(const IntSize& pendingTextureSize)
{
// Prune tiles that are no longer needed.
Vector<TileIndex> tilesToDelete;
@@ -641,7 +647,7 @@
TileIndex index = (*it).key;
IntPoint origin = originOfTile(index);
- if (origin.x() >= m_requiredTextureSize.width() || origin.y() >= m_requiredTextureSize.height())
+ if (origin.x() >= pendingTextureSize.width() || origin.y() >= pendingTextureSize.height())
tilesToDelete.append(index);
}
@@ -674,6 +680,12 @@
updateTileSize();
}
+void LayerTiler::discardBackVisibility()
+{
+ delete m_backVisibility;
+ m_backVisibility = 0;
+}
+
void LayerTiler::scheduleCommit()
{
ASSERT(isWebKitThread());
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.h (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerTiler.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -61,6 +61,7 @@
void setNeedsDisplay();
void updateTextureContentsIfNeeded(double scale);
void setNeedsBacking(bool);
+ void discardBackVisibility();
virtual void scheduleCommit();
// Compositing thread
@@ -72,6 +73,7 @@
virtual void deleteTextures(LayerCompositingThread*);
static void willCommit();
virtual void commitPendingTextureUploads(LayerCompositingThread*);
+ virtual void discardFrontVisibility();
private:
struct TextureJob {
@@ -144,7 +146,7 @@
void addTileJob(const TileIndex&, const TextureJob&, TileJobsMap&);
void performTileJob(LayerCompositingThread*, LayerTile*, const TextureJob&);
void processTextureJob(const TextureJob&, TileJobsMap&);
- void pruneTextures();
+ void pruneTextures(const IntSize& pendingTextureSize);
void visibilityChanged(bool needsDisplay);
bool drawTile(LayerCompositingThread*, LayerTile*, const TileIndex&, double scale, const FloatRect& dst, const FloatRect& dstClip);
void setFrontVisibility(const FloatRect& visibleRect, HashSet<TileIndex>& tilesNeedingRender);
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -529,6 +529,26 @@
replicaLayer()->releaseLayerResources();
}
+void LayerWebKitThread::discardBackVisibility()
+{
+ if (m_tiler)
+ m_tiler->discardBackVisibility();
+
+ size_t listSize = m_sublayers.size();
+ for (size_t i = 0; i < listSize; ++i)
+ m_sublayers[i]->discardBackVisibility();
+
+ listSize = m_overlays.size();
+ for (size_t i = 0; i < listSize; ++i)
+ m_overlays[i]->discardBackVisibility();
+
+ if (maskLayer())
+ maskLayer()->discardBackVisibility();
+
+ if (replicaLayer())
+ replicaLayer()->discardBackVisibility();
+}
+
IntRect LayerWebKitThread::mapFromTransformed(const IntRect& contentsRect, double scale)
{
IntRect untransformedContentsRect = contentsRect;
Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h (154700 => 154701)
--- trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -213,6 +213,8 @@
void releaseLayerResources();
+ void discardBackVisibility();
+
static IntRect mapFromTransformed(const IntRect&, double scale);
protected:
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (154700 => 154701)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -3559,6 +3559,11 @@
bool hasPendingOrientation = m_pendingOrientation != -1;
+#if USE(ACCELERATED_COMPOSITING)
+ if (hasPendingOrientation)
+ discardLayerVisibilities();
+#endif
+
IntSize viewportSizeBefore = actualVisibleSize();
FloatPoint centerOfVisibleContentsRect = this->centerOfVisibleContentsRect();
bool newVisibleRectContainsOldVisibleRect = (m_actualVisibleHeight <= transformedActualVisibleSize.height())
@@ -5241,6 +5246,23 @@
}
}
+void WebPagePrivate::discardLayerVisibilities()
+{
+ if (!isAcceleratedCompositingActive())
+ return;
+
+ if (m_frameLayers)
+ m_frameLayers->discardBackVisibility();
+
+ Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
+ Platform::createMethodCallMessage(&WebPagePrivate::discardFrontVisibilityCompositingThread, this));
+}
+
+void WebPagePrivate::discardFrontVisibilityCompositingThread()
+{
+ m_compositor->discardFrontVisibility();
+}
+
static bool needsLayoutRecursive(FrameView* view)
{
if (view->needsLayout())
Modified: trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp (154700 => 154701)
--- trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -296,6 +296,12 @@
findFixedElementRect(sublayers[i].get(), fixedElementRect);
}
+void WebPageCompositorPrivate::discardFrontVisibility()
+{
+ if (m_layerRenderer)
+ m_layerRenderer->discardFrontVisibility();
+}
+
WebPageCompositor::WebPageCompositor(WebPage* page, WebPageCompositorClient* client)
{
using namespace BlackBerry::Platform;
Modified: trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h (154700 => 154701)
--- trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -102,6 +102,8 @@
void findFixedElementRect(WebCore::LayerCompositingThread*, WebCore::IntRect&);
+ void discardFrontVisibility();
+
protected:
WebPageCompositorPrivate(WebPagePrivate*, WebPageCompositorClient*);
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (154700 => 154701)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -394,6 +394,7 @@
void setRootLayerWebKitThread(WebCore::Frame*, WebCore::LayerWebKitThread*);
void setNeedsOneShotDrawingSynchronization();
void scheduleRootLayerCommit();
+ void discardLayerVisibilities();
// Compositing thread.
void setRootLayerCompositingThread(WebCore::LayerCompositingThread*);
@@ -411,6 +412,7 @@
void updateRootLayerCommitEnabled();
void scheduleCompositingRun();
+ void discardFrontVisibilityCompositingThread();
#endif
bool dispatchTouchEventToFullScreenPlugin(WebCore::PluginView*, const Platform::TouchEvent&);
Modified: trunk/Source/WebKit/blackberry/ChangeLog (154700 => 154701)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-08-27 18:32:57 UTC (rev 154701)
@@ -1,3 +1,23 @@
+2013-08-27 Jacky Jiang <[email protected]>
+
+ [BlackBerry] Rotate device from landscape to portrait during youtube streaming will cause device screen flash with video list page
+ https://bugs.webkit.org/show_bug.cgi?id=120364
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Arvid Nilsson.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+ (BlackBerry::WebKit::WebPagePrivate::discardLayerVisibilities):
+ (BlackBerry::WebKit::WebPagePrivate::discardFrontVisibilityCompositingThread):
+ * Api/WebPageCompositor.cpp:
+ (BlackBerry::WebKit::WebPageCompositorPrivate::discardFrontVisibility):
+ * Api/WebPageCompositor_p.h:
+ * Api/WebPage_p.h:
+ * WebKitSupport/FrameLayers.cpp:
+ (BlackBerry::WebKit::FrameLayers::discardBackVisibility):
+ * WebKitSupport/FrameLayers.h:
+
2013-08-26 Pratik Solanki <[email protected]>
PageGroup::groupSettings() should return a reference
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp (154700 => 154701)
--- trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp 2013-08-27 18:32:57 UTC (rev 154701)
@@ -130,6 +130,12 @@
m_rootLayer->releaseLayerResources();
}
+void FrameLayers::discardBackVisibility()
+{
+ if (m_rootLayer)
+ m_rootLayer->discardBackVisibility();
+}
+
} // namespace BlackBerry
} // namespace WebKit
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h (154700 => 154701)
--- trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h 2013-08-27 18:22:25 UTC (rev 154700)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h 2013-08-27 18:32:57 UTC (rev 154701)
@@ -60,6 +60,8 @@
void releaseLayerResources();
+ void discardBackVisibility();
+
private:
WebPagePrivate* m_pagePrivate;
OwnPtr<WebCore::GraphicsLayer> m_rootGraphicsLayer;