WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-130072-20140312202455.patch (text/plain), 11.92 KB, created by
Hyowon Kim
on 2014-03-12 04:25:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Hyowon Kim
Created:
2014-03-12 04:25:17 PDT
Size:
11.92 KB
patch
obsolete
>Subversion Revision: 165432 >diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog >index eb7ab92e26569b0630b585be87285c6b63027b8f..6429996ea1c523257737854900b6d232ec86a7e1 100644 >--- a/Source/WebKit/efl/ChangeLog >+++ b/Source/WebKit/efl/ChangeLog >@@ -1,3 +1,30 @@ >+2014-03-12 Hyowon Kim <hw1008.kim@samsung.com> >+ >+ [EFL] Revise AcceleratedCompositingEfl implementation. >+ https://bugs.webkit.org/show_bug.cgi?id=130072 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch revises the AcceleratedCompositingEfl class implementation >+ similar with gtk port. >+ And accelerated compositing will be enabled by default on WK1 efl. >+ >+ * WebCoreSupport/AcceleratedCompositingContextEfl.cpp: >+ (WebCore::AcceleratedCompositingContext::AcceleratedCompositingContext): >+ (WebCore::AcceleratedCompositingContext::initialize): >+ (WebCore::AcceleratedCompositingContext::syncLayers): >+ (WebCore::AcceleratedCompositingContext::resize): >+ (WebCore::AcceleratedCompositingContext::canComposite): >+ (WebCore::AcceleratedCompositingContext::flushAndRenderLayers): >+ (WebCore::AcceleratedCompositingContext::flushPendingLayerChanges): >+ (WebCore::AcceleratedCompositingContext::compositeLayersToContext): >+ (WebCore::AcceleratedCompositingContext::attachRootGraphicsLayer): >+ * WebCoreSupport/AcceleratedCompositingContextEfl.h: >+ * ewk/ewk_view.cpp: >+ (_ewk_view_priv_new): >+ (_ewk_view_accelerated_compositing_cb): >+ (_ewk_view_accelerated_compositing_context_create_if_needed): >+ > 2014-03-10 Hyowon Kim <hw1008.kim@samsung.com> > > [EFL] Modify accelerated compositing related functions in ewk_view. >diff --git a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp >index acd0886c07f1508bfa4302c77d1c2c090ef62570..1d05e6f76d5529b1f9f5d0c2c3db4ea177808b20 100644 >--- a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp >+++ b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp >@@ -22,41 +22,31 @@ > #if USE(TEXTURE_MAPPER_GL) > > #include "AcceleratedCompositingContextEfl.h" >-#include "FrameView.h" > #include "GraphicsLayerTextureMapper.h" >-#include "HostWindow.h" > #include "MainFrame.h" > #include "TextureMapperGL.h" > #include "TextureMapperLayer.h" > #include "ewk_view_private.h" > >-namespace WebCore { >- >-PassOwnPtr<AcceleratedCompositingContext> AcceleratedCompositingContext::create(HostWindow* hostWindow) >-{ >- OwnPtr<AcceleratedCompositingContext> context = adoptPtr(new AcceleratedCompositingContext); >- if (!context->initialize(hostWindow)) >- return nullptr; >+const double compositingFrameRate = 60; > >- return context.release(); >-} >+namespace WebCore { > >-AcceleratedCompositingContext::AcceleratedCompositingContext() >- : m_view(0) >- , m_rootTextureMapperLayer(0) >+AcceleratedCompositingContext::AcceleratedCompositingContext(Evas_Object* ewkView, Evas_Object* compositingObject) >+ : m_view(ewkView) >+ , m_compositingObject(compositingObject) >+ , m_syncTimer(this, &AcceleratedCompositingContext::syncLayers) > { >+ ASSERT(m_view); >+ ASSERT(m_compositingObject); > } > > AcceleratedCompositingContext::~AcceleratedCompositingContext() > { > } > >-bool AcceleratedCompositingContext::initialize(HostWindow* hostWindow) >+bool AcceleratedCompositingContext::initialize() > { >- m_view = hostWindow->platformPageClient(); >- if (!m_view) >- return false; >- > m_evasGL = adoptPtr(evas_gl_new(evas_object_evas_get(m_view))); > if (!m_evasGL) > return false; >@@ -76,6 +66,11 @@ bool AcceleratedCompositingContext::initialize(HostWindow* hostWindow) > return resize(webViewSize); > } > >+void AcceleratedCompositingContext::syncLayers(Timer<AcceleratedCompositingContext>*) >+{ >+ ewk_view_mark_for_sync(m_view); >+} >+ > bool AcceleratedCompositingContext::resize(const IntSize& size) > { > static Evas_GL_Config evasGLConfig = { >@@ -90,33 +85,62 @@ bool AcceleratedCompositingContext::resize(const IntSize& size) > if (!m_evasGLSurface) > return false; > >+ Evas_Native_Surface nativeSurface; >+ evas_gl_native_surface_get(m_evasGL.get(), m_evasGLSurface->surface(), &nativeSurface); >+ evas_object_image_native_surface_set(m_compositingObject, &nativeSurface); > return true; > } > >-void AcceleratedCompositingContext::syncLayersNow() >+bool AcceleratedCompositingContext::canComposite() > { >- if (m_rootGraphicsLayer) >- m_rootGraphicsLayer->flushCompositingStateForThisLayerOnly(); >- >- EWKPrivate::corePage(m_view)->mainFrame().view()->flushCompositingStateIncludingSubframes(); >+ return m_rootGraphicsLayer && m_textureMapper; > } > >-void AcceleratedCompositingContext::renderLayers() >+void AcceleratedCompositingContext::flushAndRenderLayers() > { >- if (!m_rootGraphicsLayer) >+ if (!canComposite()) >+ return; >+ >+ MainFrame& frame = EWKPrivate::corePage(m_view)->mainFrame(); >+ if (!frame.contentRenderer() || !frame.view()) >+ return; >+ frame.view()->updateLayoutAndStyleIfNeededRecursive(); >+ >+ if (!canComposite()) > return; > > if (!evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context())) > return; > >+ if (!flushPendingLayerChanges()) >+ return; >+ >+ compositeLayersToContext(); >+ >+ if (toTextureMapperLayer(m_rootGraphicsLayer.get())->descendantsOrSelfHaveRunningAnimations() && !m_syncTimer.isActive()) >+ m_syncTimer.startOneShot(1 / compositingFrameRate); >+} >+ >+bool AcceleratedCompositingContext::flushPendingLayerChanges() >+{ >+ m_rootGraphicsLayer->flushCompositingStateForThisLayerOnly(); >+ return EWKPrivate::corePage(m_view)->mainFrame().view()->flushCompositingStateIncludingSubframes(); >+} >+ >+void AcceleratedCompositingContext::compositeLayersToContext() >+{ > Evas_Coord width = 0; > Evas_Coord height = 0; > evas_object_geometry_get(m_view, 0, 0, &width, &height); >+ > evas_gl_api_get(m_evasGL.get())->glViewport(0, 0, width, height); >+ evas_gl_api_get(m_evasGL.get())->glClear(GL_COLOR_BUFFER_BIT); > > m_textureMapper->beginPainting(); >- m_rootTextureMapperLayer->paint(); >+ m_textureMapper->beginClip(TransformationMatrix(), FloatRect(0, 0, width, height)); >+ toTextureMapperLayer(m_rootGraphicsLayer.get())->paint(); > m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get()); >+ m_textureMapper->endClip(); > m_textureMapper->endPainting(); > } > >@@ -124,19 +148,21 @@ void AcceleratedCompositingContext::attachRootGraphicsLayer(GraphicsLayer* rootL > { > if (!rootLayer) { > m_rootGraphicsLayer = nullptr; >- m_rootTextureMapperLayer = 0; > return; > } > >- m_rootGraphicsLayer = WebCore::GraphicsLayer::create(0, 0); >- m_rootTextureMapperLayer = toTextureMapperLayer(m_rootGraphicsLayer.get()); >+ if (!m_textureMapper) { >+ evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context()); >+ m_textureMapper = TextureMapperGL::create(); >+ } >+ >+ m_rootGraphicsLayer = GraphicsLayer::create(0, 0); > m_rootGraphicsLayer->addChild(rootLayer); > m_rootGraphicsLayer->setDrawsContent(false); > m_rootGraphicsLayer->setMasksToBounds(false); >- m_rootGraphicsLayer->setSize(WebCore::IntSize(1, 1)); >+ m_rootGraphicsLayer->setSize(IntSize(1, 1)); > >- m_textureMapper = TextureMapperGL::create(); >- m_rootTextureMapperLayer->setTextureMapper(m_textureMapper.get()); >+ toTextureMapperLayer(m_rootGraphicsLayer.get())->setTextureMapper(m_textureMapper.get()); > > m_rootGraphicsLayer->flushCompositingStateForThisLayerOnly(); > } >diff --git a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h >index 7507c917d6158c2fde24325ac45d37b7912ea1ff..93a727a09c48b200df6156116b2d5fe8ecf49d78 100644 >--- a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h >+++ b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h >@@ -24,6 +24,7 @@ > #include "EvasGLContext.h" > #include "EvasGLSurface.h" > #include "TextureMapperFPSCounter.h" >+#include "Timer.h" > #include <wtf/Noncopyable.h> > #include <wtf/OwnPtr.h> > >@@ -37,25 +38,29 @@ class TextureMapperLayer; > class AcceleratedCompositingContext { > WTF_MAKE_NONCOPYABLE(AcceleratedCompositingContext); > public: >- static PassOwnPtr<AcceleratedCompositingContext> create(HostWindow*); >- virtual ~AcceleratedCompositingContext(); >+ AcceleratedCompositingContext(Evas_Object* ewkView, Evas_Object* compositingObject); >+ ~AcceleratedCompositingContext(); >+ >+ bool initialize(); > > bool resize(const IntSize&); >+ void attachRootGraphicsLayer(GraphicsLayer* rootLayer); > >- virtual void syncLayersNow(); >- virtual void renderLayers(); >- virtual void attachRootGraphicsLayer(GraphicsLayer* rootLayer); >+ void flushAndRenderLayers(); >+ bool flushPendingLayerChanges(); >+ void compositeLayersToContext(); > >-private: >- AcceleratedCompositingContext(); >+ bool canComposite(); > >- virtual bool initialize(HostWindow*); >+ void syncLayers(Timer<AcceleratedCompositingContext>*); > >+private: > Evas_Object* m_view; >+ Evas_Object* m_compositingObject; > > OwnPtr<TextureMapper> m_textureMapper; > std::unique_ptr<GraphicsLayer> m_rootGraphicsLayer; >- TextureMapperLayer* m_rootTextureMapperLayer; >+ Timer<AcceleratedCompositingContext> m_syncTimer; > > OwnPtr<Evas_GL> m_evasGL; > OwnPtr<EvasGLContext> m_evasGLContext; >diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp >index a1739a0da41a18b81f62518ac3c23748313f8cef..99970ecc6d50c72e3ed5dae8ce88059340632f9a 100644 >--- a/Source/WebKit/efl/ewk/ewk_view.cpp >+++ b/Source/WebKit/efl/ewk/ewk_view.cpp >@@ -254,7 +254,7 @@ struct _Ewk_View_Private_Data { > OwnPtr<WebCore::Page> page; > WebCore::ViewportArguments viewportArguments; > Ewk_History* history; >- OwnPtr<WebCore::AcceleratedCompositingContext> acceleratedCompositingContext; >+ std::unique_ptr<WebCore::AcceleratedCompositingContext> acceleratedCompositingContext; > bool isCompositingActive; > RefPtr<Evas_Object> compositingObject; > #if ENABLE(INPUT_TYPE_COLOR) >@@ -746,7 +746,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) > pageSettings.setFullScreenEnabled(true); > #endif > pageSettings.setInteractiveFormValidationEnabled(true); >- pageSettings.setAcceleratedCompositingEnabled(false); >+ pageSettings.setAcceleratedCompositingEnabled(true); > char* debugVisualsEnvironment = getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS"); > bool showDebugVisuals = debugVisualsEnvironment && !strcmp(debugVisualsEnvironment, "1"); > pageSettings.setShowDebugBorders(showDebugVisuals); >@@ -4630,10 +4630,8 @@ void _ewk_view_accelerated_compositing_cb(void* data, Evas_Object*) > { > Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data); > >- if (priv->isCompositingActive) { >- priv->acceleratedCompositingContext->syncLayersNow(); >- priv->acceleratedCompositingContext->renderLayers(); >- } >+ if (priv->isCompositingActive) >+ priv->acceleratedCompositingContext->flushAndRenderLayers(); > } > > bool _ewk_view_accelerated_compositing_context_create_if_needed(Evas_Object* ewkView) >@@ -4642,9 +4640,11 @@ bool _ewk_view_accelerated_compositing_context_create_if_needed(Evas_Object* ewk > EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); > > if (!priv->acceleratedCompositingContext) { >- priv->acceleratedCompositingContext = WebCore::AcceleratedCompositingContext::create(&priv->page->chrome()); >- if (!priv->acceleratedCompositingContext) >+ priv->acceleratedCompositingContext = std::make_unique<WebCore::AcceleratedCompositingContext>(ewkView, priv->compositingObject.get()); >+ if (!priv->acceleratedCompositingContext->initialize()) { >+ priv->acceleratedCompositingContext = nullptr; > return false; >+ } > } > return true; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 130072
:
226399
|
226463
|
226490
| 226494