Skip to content
Permalink
Browse files
[BlackBerry] Remove obsolete compositing surface code
https://bugs.webkit.org/show_bug.cgi?id=97314

Reviewed by Antonio Gomes.

Source/WebKit:

Remove compositing surface code from build system.

PR 208038.

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

The removed code allowed rendering of sublayers to a separate offscreen
surface.

Now that we composite root layer and all sublayers to the window
surface, this code is not needed anymore. In addition, we save some
memory by not allocating the unused offscreen surface.

PR 208038.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::suspendScreenAndBackingStoreUpdates):
(BlackBerry::WebKit::BackingStorePrivate::blitContents):
(BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::suspendBackingStore):
(BlackBerry::WebKit::WebPagePrivate::resizeSurfaceIfNeeded):
(BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):
(BlackBerry::WebKit::WebPagePrivate::setRootLayerCompositingThread):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/BackingStoreCompositingSurface.cpp: Removed.
* WebKitSupport/BackingStoreCompositingSurface.h: Removed.
* WebKitSupport/GLES2Context.cpp:
(BlackBerry::WebKit::GLES2Context::buffer):
(BlackBerry::WebKit::GLES2Context::surfaceSize):
(BlackBerry::WebKit::GLES2Context::swapBuffers):
* WebKitSupport/GLES2Context.h:
(GLES2Context):
* WebKitSupport/SurfacePool.cpp:
(WebKit):
(BlackBerry::WebKit::SurfacePool::SurfacePool):
(BlackBerry::WebKit::SurfacePool::initialize):
* WebKitSupport/SurfacePool.h:
(SurfacePool):


Canonical link: https://commits.webkit.org/115268@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anilsson committed Sep 21, 2012
1 parent af55ea2 commit 3b219e0f12951366f15408d2b9c8485545f47446
@@ -1,3 +1,16 @@
2012-09-21 Arvid Nilsson <anilsson@rim.com>

[BlackBerry] Remove obsolete compositing surface code
https://bugs.webkit.org/show_bug.cgi?id=97314

Reviewed by Antonio Gomes.

Remove compositing surface code from build system.

PR 208038.

* PlatformBlackBerry.cmake:

2012-09-14 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>

[Qt] Make force_static_libs_as_shared work on Mac OS
@@ -94,7 +94,6 @@ LIST(APPEND WebKit_SOURCES
blackberry/WebCoreSupport/DatePickerClient.cpp
blackberry/WebCoreSupport/ColorPickerClient.cpp
blackberry/WebKitSupport/AboutData.cpp
blackberry/WebKitSupport/BackingStoreCompositingSurface.cpp
blackberry/WebKitSupport/BackingStoreTile.cpp
blackberry/WebKitSupport/BackingStoreClient.cpp
blackberry/WebKitSupport/DefaultTapHighlight.cpp
@@ -20,7 +20,6 @@
#include "BackingStore.h"

#include "BackingStoreClient.h"
#include "BackingStoreCompositingSurface.h"
#include "BackingStoreTile.h"
#include "BackingStore_p.h"
#include "FatFingers.h"
@@ -62,7 +61,6 @@
#define DEBUG_WEBCORE_REQUESTS 0
#define DEBUG_VISUALIZE 0
#define DEBUG_TILEMATRIX 0
#define DEBUG_COMPOSITING_DIRTY_REGION 0

using namespace WebCore;
using namespace std;
@@ -293,10 +291,6 @@ void BackingStorePrivate::suspendScreenAndBackingStoreUpdates()
++m_suspendScreenUpdates;

BlackBerry::Platform::userInterfaceThreadMessageClient()->syncToCurrentMessage();

#if USE(ACCELERATED_COMPOSITING)
m_webPage->d->resetCompositingSurface();
#endif
}

void BackingStorePrivate::resumeScreenAndBackingStoreUpdates(BackingStore::ResumeUpdateOperation op)
@@ -1489,9 +1483,6 @@ void BackingStorePrivate::blitContents(const Platform::IntRect& dstRect,
if (compositor->drawsRootLayer())
paintDefaultBackground(contents, transformation, false /*flush*/);
}

if (!isOpenGLCompositing())
blendCompositingSurface(dstRect);
#endif

#if ENABLE_SCROLLBARS
@@ -1659,60 +1650,6 @@ Platform::IntRect BackingStorePrivate::blitTileRect(TileBuffer* tileBuffer,
return dirtyRect;
}

#if USE(ACCELERATED_COMPOSITING)
void BackingStorePrivate::blendCompositingSurface(const Platform::IntRect& dstRect)
{
if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
typedef void (BlackBerry::WebKit::BackingStorePrivate::*FunctionType)(const Platform::IntRect&);
BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage(
BlackBerry::Platform::createMethodCallMessage<FunctionType, BackingStorePrivate, Platform::IntRect>(
&BackingStorePrivate::blendCompositingSurface, this, dstRect));
return;
}

BackingStoreCompositingSurface* compositingSurface =
SurfacePool::globalSurfacePool()->compositingSurface();

if (!compositingSurface || !m_webPage->isVisible())
return;

WebCore::LayerRenderingResults lastCompositingResults = m_webPage->d->lastCompositingResults();
for (size_t i = 0; i < lastCompositingResults.holePunchRectSize(); i++) {
Platform::IntRect holePunchRect = lastCompositingResults.holePunchRect(i);

holePunchRect.intersect(dstRect);
holePunchRect.intersect(Platform::IntRect(
Platform::IntPoint(0, 0), surfaceSize()));

if (!holePunchRect.isEmpty())
clearWindow(holePunchRect, 0, 0, 0, 0);
}

CompositingSurfaceBuffer* frontBuffer = compositingSurface->frontBuffer();

IntRectList rects = lastCompositingResults.dirtyRegion.rects();
for (size_t i = 0; i < rects.size(); ++i) {
rects[i].intersect(dstRect);
#if DEBUG_COMPOSITING_DIRTY_REGION
clearBuffer(buffer(), rects[i], 255, 0, 0, 128);
#endif
blitToWindow(rects[i], frontBuffer->nativeBuffer(), rects[i], true /*blend*/, 255);
}
}

void BackingStorePrivate::clearCompositingSurface()
{
BackingStoreCompositingSurface* compositingSurface =
SurfacePool::globalSurfacePool()->compositingSurface();

if (!compositingSurface)
return;

CompositingSurfaceBuffer* frontBuffer = compositingSurface->frontBuffer();
BlackBerry::Platform::Graphics::clearBuffer(frontBuffer->nativeBuffer(), Platform::IntRect(Platform::IntPoint(), frontBuffer->surfaceSize()), 0, 0, 0, 0);
}
#endif // USE(ACCELERATED_COMPOSITING)

void BackingStorePrivate::blitHorizontalScrollbar(const Platform::IntPoint& scrollPosition)
{
if (!m_webPage->isVisible())
@@ -2614,15 +2551,6 @@ void BackingStorePrivate::drawAndBlendLayersForDirectRendering(const Platform::I
// Check if rendering caused a commit and we need to redraw the layers.
if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor())
compositor->drawLayers(dstRect, untransformedContentsRect);

#if ENABLE_COMPOSITING_SURFACE
// See above comment about sync calling, visibleContentsRect() is safe here.
Platform::IntRect visibleDirtyRect = dirtyRect;
visibleDirtyRect.intersect(visibleContentsRect());
visibleDirtyRect = m_client->mapFromTransformedContentsToTransformedViewport(visibleDirtyRect);

blendCompositingSurface(visibleDirtyRect);
#endif
}
#endif

@@ -207,9 +207,6 @@ class BackingStorePrivate : public BlackBerry::Platform::GuardedPointerBase {
// calling this.
void compositeContents(WebCore::LayerRenderer*, const WebCore::TransformationMatrix&, const WebCore::FloatRect& contents, bool contentsOpaque);

void blendCompositingSurface(const Platform::IntRect& dstRect);
void clearCompositingSurface();

bool drawLayersOnCommitIfNeeded();
void drawAndBlendLayersForDirectRendering(const Platform::IntRect& dirtyRect);
// WebPage will call this when drawing layers to tell us we don't need to
@@ -25,7 +25,6 @@
#include "BackForwardController.h"
#include "BackForwardListImpl.h"
#include "BackingStoreClient.h"
#include "BackingStoreCompositingSurface.h"
#include "BackingStore_p.h"
#if ENABLE(BATTERY_STATUS)
#include "BatteryClientBlackBerry.h"
@@ -1130,10 +1129,6 @@ void WebPagePrivate::setLoadState(LoadState state)
// Update cursor status.
updateCursor();

#if USE(ACCELERATED_COMPOSITING)
// Don't render compositing contents from previous page.
resetCompositingSurface();
#endif
break;
}
case Finished:
@@ -3541,8 +3536,6 @@ void WebPagePrivate::suspendBackingStore()

return;
}

resetCompositingSurface();
#endif
}

@@ -3633,9 +3626,6 @@ void WebPagePrivate::resizeSurfaceIfNeeded()
return;
}

if (m_pendingOrientation != -1)
SurfacePool::globalSurfacePool()->notifyScreenRotated();

m_client->resizeSurfaceIfNeeded();
}

@@ -5688,14 +5678,11 @@ void WebPagePrivate::rootLayerCommitTimerFired(Timer<WebPagePrivate>*)
// backing store is never necessary, because the backing store draws
// nothing.
if (!compositorDrawsRootLayer()) {
bool isSingleTargetWindow = SurfacePool::globalSurfacePool()->compositingSurface()
|| m_backingStore->d->isOpenGLCompositing();

// If we are doing direct rendering and have a single rendering target,
// committing is equivalent to a one shot drawing synchronization.
// We need to re-render the web page, re-render the layers, and
// then blit them on top of the re-rendered web page.
if (isSingleTargetWindow && m_backingStore->d->shouldDirectRenderingToWindow())
if (m_backingStore->d->isOpenGLCompositing() && m_backingStore->d->shouldDirectRenderingToWindow())
setNeedsOneShotDrawingSynchronization();

if (needsOneShotDrawingSynchronization()) {
@@ -5712,19 +5699,6 @@ void WebPagePrivate::rootLayerCommitTimerFired(Timer<WebPagePrivate>*)
commitRootLayerIfNeeded();
}

void WebPagePrivate::resetCompositingSurface()
{
if (!Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
Platform::userInterfaceThreadMessageClient()->dispatchMessage(
Platform::createMethodCallMessage(
&WebPagePrivate::resetCompositingSurface, this));
return;
}

if (m_compositor)
m_compositor->setLastCompositingResults(LayerRenderingResults());
}

void WebPagePrivate::setRootLayerWebKitThread(Frame* frame, LayerWebKitThread* layer)
{
// This method updates the FrameLayers based on input from WebCore.
@@ -5763,12 +5737,7 @@ void WebPagePrivate::setRootLayerCompositingThread(LayerCompositingThread* layer
return;
}

if (!layer) {
// Keep the compositor around, a single web page will frequently enter
// and leave compositing mode many times. Instead we destroy it when
// navigating to a new page.
resetCompositingSurface();
} else if (!m_compositor)
if (layer && !m_compositor)
createCompositor();

// Don't ASSERT(m_compositor) here because setIsAcceleratedCompositingActive(true)
@@ -407,9 +407,6 @@ class WebPagePrivate : public PageClientBlackBerry
void setNeedsOneShotDrawingSynchronization();
void scheduleRootLayerCommit();

// Thread safe.
void resetCompositingSurface();

// Compositing thread.
void setRootLayerCompositingThread(WebCore::LayerCompositingThread*);
void commitRootLayer(const WebCore::IntRect&, const WebCore::IntSize&, bool);
@@ -1,3 +1,48 @@
2012-09-21 Arvid Nilsson <anilsson@rim.com>

[BlackBerry] Remove obsolete compositing surface code
https://bugs.webkit.org/show_bug.cgi?id=97314

Reviewed by Antonio Gomes.

The removed code allowed rendering of sublayers to a separate offscreen
surface.

Now that we composite root layer and all sublayers to the window
surface, this code is not needed anymore. In addition, we save some
memory by not allocating the unused offscreen surface.

PR 208038.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::suspendScreenAndBackingStoreUpdates):
(BlackBerry::WebKit::BackingStorePrivate::blitContents):
(BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::suspendBackingStore):
(BlackBerry::WebKit::WebPagePrivate::resizeSurfaceIfNeeded):
(BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):
(BlackBerry::WebKit::WebPagePrivate::setRootLayerCompositingThread):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/BackingStoreCompositingSurface.cpp: Removed.
* WebKitSupport/BackingStoreCompositingSurface.h: Removed.
* WebKitSupport/GLES2Context.cpp:
(BlackBerry::WebKit::GLES2Context::buffer):
(BlackBerry::WebKit::GLES2Context::surfaceSize):
(BlackBerry::WebKit::GLES2Context::swapBuffers):
* WebKitSupport/GLES2Context.h:
(GLES2Context):
* WebKitSupport/SurfacePool.cpp:
(WebKit):
(BlackBerry::WebKit::SurfacePool::SurfacePool):
(BlackBerry::WebKit::SurfacePool::initialize):
* WebKitSupport/SurfacePool.h:
(SurfacePool):

2012-09-20 Peter Wang <peter.wang@torchmobile.com.cn>

[BlackBerry] To support "Frames View" of "TimeLine" panel in Inspector

0 comments on commit 3b219e0

Please sign in to comment.