<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166637] trunk/Source/WebKit/efl</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166637">166637</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-02 02:23:10 -0700 (Wed, 02 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[EFL] Composite all layers into one evas_object using TextureMapper.
https://bugs.webkit.org/show_bug.cgi?id=130969
Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2014-04-02
Reviewed by Gyuyoung Kim.
The EFL port uses two evas_objects to render the entire webpage: backing_store and compositingObject.
backing_store is used to paint a non-composited layer with ewk functions,
whereas compositingObject is used to paint other layers with TextureMapper.
These evas_objects are eventually composited into the window buffer by Evas.
This patch moves to use only one evas_object by integrating these two evas_objects,
and makes that TextureMapper handles all rendering paths like WebKit2.
* WebCoreSupport/AcceleratedCompositingContextEfl.cpp:
(WebCore::AcceleratedCompositingContext::AcceleratedCompositingContext):
(WebCore::AcceleratedCompositingContext::~AcceleratedCompositingContext):
(WebCore::AcceleratedCompositingContext::resize):
(WebCore::AcceleratedCompositingContext::flushAndRenderLayers):
(WebCore::AcceleratedCompositingContext::flushPendingLayerChanges):
(WebCore::AcceleratedCompositingContext::paintToGraphicsContext):
(WebCore::AcceleratedCompositingContext::paintToCurrentGLContext):
(WebCore::AcceleratedCompositingContext::compositeLayers):
(WebCore::AcceleratedCompositingContext::initialize): Deleted.
(WebCore::AcceleratedCompositingContext::canComposite): Deleted.
(WebCore::AcceleratedCompositingContext::compositeLayersToContext): Deleted.
(WebCore::AcceleratedCompositingContext::attachRootGraphicsLayer): Deleted.
* WebCoreSupport/AcceleratedCompositingContextEfl.h:
(WebCore::AcceleratedCompositingContext::setRootGraphicsLayer):
* ewk/ewk_view.cpp:
(_ewk_view_priv_new):
(_ewk_view_accelerated_compositing_cb):
(_ewk_view_smart_add):
(_ewk_view_smart_resize):
(_ewk_view_smart_calculate):
(_ewk_view_smart_show):
(_ewk_view_smart_hide):
(_ewk_view_smart_flush):
(_ewk_view_smart_zoom_weak_set):
(_ewk_view_smart_zoom_weak_smooth_scale_set):
(ewk_view_bg_color_set):
(ewk_view_scroll):
(ewk_view_root_graphics_layer_set):
(ewk_view_mark_for_sync):
(_ewk_view_scrolls_flush): Deleted.
(_ewk_view_scroll_process): Deleted.
(_ewk_view_smart_scrolls_process): Deleted.
(_ewk_view_smart_repaints_process): Deleted.
(ewk_view_scrolls_process): Deleted.
(_ewk_view_accelerated_compositing_context_create_if_needed): Deleted.
(_ewk_view_accelerated_compositing_object_create_if_needed): Deleted.
* ewk/ewk_view.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKiteflChangeLog">trunk/Source/WebKit/efl/ChangeLog</a></li>
<li><a href="#trunkSourceWebKiteflWebCoreSupportAcceleratedCompositingContextEflcpp">trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp</a></li>
<li><a href="#trunkSourceWebKiteflWebCoreSupportAcceleratedCompositingContextEflh">trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h</a></li>
<li><a href="#trunkSourceWebKiteflewkewk_viewcpp">trunk/Source/WebKit/efl/ewk/ewk_view.cpp</a></li>
<li><a href="#trunkSourceWebKiteflewkewk_viewh">trunk/Source/WebKit/efl/ewk/ewk_view.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKiteflChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ChangeLog (166636 => 166637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ChangeLog        2014-04-02 09:14:36 UTC (rev 166636)
+++ trunk/Source/WebKit/efl/ChangeLog        2014-04-02 09:23:10 UTC (rev 166637)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-04-02 Hyowon Kim <hw1008.kim@samsung.com>
+
+ [EFL] Composite all layers into one evas_object using TextureMapper.
+ https://bugs.webkit.org/show_bug.cgi?id=130969
+
+ Reviewed by Gyuyoung Kim.
+
+ The EFL port uses two evas_objects to render the entire webpage: backing_store and compositingObject.
+ backing_store is used to paint a non-composited layer with ewk functions,
+ whereas compositingObject is used to paint other layers with TextureMapper.
+ These evas_objects are eventually composited into the window buffer by Evas.
+
+ This patch moves to use only one evas_object by integrating these two evas_objects,
+ and makes that TextureMapper handles all rendering paths like WebKit2.
+
+ * WebCoreSupport/AcceleratedCompositingContextEfl.cpp:
+ (WebCore::AcceleratedCompositingContext::AcceleratedCompositingContext):
+ (WebCore::AcceleratedCompositingContext::~AcceleratedCompositingContext):
+ (WebCore::AcceleratedCompositingContext::resize):
+ (WebCore::AcceleratedCompositingContext::flushAndRenderLayers):
+ (WebCore::AcceleratedCompositingContext::flushPendingLayerChanges):
+ (WebCore::AcceleratedCompositingContext::paintToGraphicsContext):
+ (WebCore::AcceleratedCompositingContext::paintToCurrentGLContext):
+ (WebCore::AcceleratedCompositingContext::compositeLayers):
+ (WebCore::AcceleratedCompositingContext::initialize): Deleted.
+ (WebCore::AcceleratedCompositingContext::canComposite): Deleted.
+ (WebCore::AcceleratedCompositingContext::compositeLayersToContext): Deleted.
+ (WebCore::AcceleratedCompositingContext::attachRootGraphicsLayer): Deleted.
+ * WebCoreSupport/AcceleratedCompositingContextEfl.h:
+ (WebCore::AcceleratedCompositingContext::setRootGraphicsLayer):
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+ (_ewk_view_accelerated_compositing_cb):
+ (_ewk_view_smart_add):
+ (_ewk_view_smart_resize):
+ (_ewk_view_smart_calculate):
+ (_ewk_view_smart_show):
+ (_ewk_view_smart_hide):
+ (_ewk_view_smart_flush):
+ (_ewk_view_smart_zoom_weak_set):
+ (_ewk_view_smart_zoom_weak_smooth_scale_set):
+ (ewk_view_bg_color_set):
+ (ewk_view_scroll):
+ (ewk_view_root_graphics_layer_set):
+ (ewk_view_mark_for_sync):
+ (_ewk_view_scrolls_flush): Deleted.
+ (_ewk_view_scroll_process): Deleted.
+ (_ewk_view_smart_scrolls_process): Deleted.
+ (_ewk_view_smart_repaints_process): Deleted.
+ (ewk_view_scrolls_process): Deleted.
+ (_ewk_view_accelerated_compositing_context_create_if_needed): Deleted.
+ (_ewk_view_accelerated_compositing_object_create_if_needed): Deleted.
+ * ewk/ewk_view.h:
+
</ins><span class="cx"> 2014-03-23 Hyowon Kim <hw1008.kim@samsung.com>
</span><span class="cx">
</span><span class="cx"> Move all EFL typedefs into EflTypedefs.h.
</span></span></pre></div>
<a id="trunkSourceWebKiteflWebCoreSupportAcceleratedCompositingContextEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp (166636 => 166637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp        2014-04-02 09:14:36 UTC (rev 166636)
+++ trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp        2014-04-02 09:23:10 UTC (rev 166637)
</span><span class="lines">@@ -22,10 +22,13 @@
</span><span class="cx"> #if USE(TEXTURE_MAPPER_GL)
</span><span class="cx">
</span><span class="cx"> #include "AcceleratedCompositingContextEfl.h"
</span><ins>+#include "CairoUtilitiesEfl.h"
</ins><span class="cx"> #include "GraphicsLayerTextureMapper.h"
</span><span class="cx"> #include "MainFrame.h"
</span><ins>+#include "PlatformContextCairo.h"
</ins><span class="cx"> #include "TextureMapperGL.h"
</span><span class="cx"> #include "TextureMapperLayer.h"
</span><ins>+#include "ewk_private.h"
</ins><span class="cx"> #include "ewk_view_private.h"
</span><span class="cx">
</span><span class="cx"> const double compositingFrameRate = 60;
</span><span class="lines">@@ -35,44 +38,44 @@
</span><span class="cx"> AcceleratedCompositingContext::AcceleratedCompositingContext(Evas_Object* ewkView, Evas_Object* compositingObject)
</span><span class="cx"> : m_view(ewkView)
</span><span class="cx"> , m_compositingObject(compositingObject)
</span><ins>+ , m_rootLayer(nullptr)
</ins><span class="cx"> , m_syncTimer(this, &AcceleratedCompositingContext::syncLayers)
</span><ins>+ , m_isAccelerated(true)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_view);
</span><span class="cx"> ASSERT(m_compositingObject);
</span><ins>+
+ Evas* evas = evas_object_evas_get(m_view);
+ const char* engine = ecore_evas_engine_name_get(ecore_evas_ecore_evas_get(evas));
+ if (!strncmp(engine, "opengl_x11", strlen("opengl_x11"))) {
+ m_evasGL = EflUniquePtr<Evas_GL>(evas_gl_new(evas_object_evas_get(m_view)));
+ if (m_evasGL)
+ m_evasGLContext = EvasGLContext::create(m_evasGL.get());
+ }
+
+ if (!m_evasGLContext)
+ m_isAccelerated = false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AcceleratedCompositingContext::~AcceleratedCompositingContext()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool AcceleratedCompositingContext::initialize()
-{
- m_evasGL = EflUniquePtr<Evas_GL>(evas_gl_new(evas_object_evas_get(m_view)));
- if (!m_evasGL)
- return false;
-
- m_evasGLContext = EvasGLContext::create(m_evasGL.get());
- if (!m_evasGLContext)
- return false;
-
- Evas_Coord width = 0;
- Evas_Coord height = 0;
- evas_object_geometry_get(m_view, 0, 0, &width, &height);
-
- IntSize webViewSize(width, height);
- if (webViewSize.isEmpty())
- return false;
-
- return resize(webViewSize);
-}
-
</del><span class="cx"> void AcceleratedCompositingContext::syncLayers(Timer<AcceleratedCompositingContext>*)
</span><span class="cx"> {
</span><span class="cx"> ewk_view_mark_for_sync(m_view);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool AcceleratedCompositingContext::resize(const IntSize& size)
</del><ins>+void AcceleratedCompositingContext::resize(const IntSize& size)
</ins><span class="cx"> {
</span><ins>+ if (m_viewSize == size)
+ return;
+
+ m_viewSize = size;
+
+ if (!m_isAccelerated)
+ return;
+
</ins><span class="cx"> static Evas_GL_Config evasGLConfig = {
</span><span class="cx"> EVAS_GL_RGBA_8888,
</span><span class="cx"> EVAS_GL_DEPTH_BIT_8,
</span><span class="lines">@@ -82,91 +85,102 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> m_evasGLSurface = EvasGLSurface::create(m_evasGL.get(), &evasGLConfig, size);
</span><del>- if (!m_evasGLSurface)
- return false;
</del><ins>+ if (!m_evasGLSurface) {
+ ERR("Failed to create a EvasGLSurface.");
+ return;
+ }
</ins><span class="cx">
</span><span class="cx"> Evas_Native_Surface nativeSurface;
</span><span class="cx"> evas_gl_native_surface_get(m_evasGL.get(), m_evasGLSurface->surface(), &nativeSurface);
</span><span class="cx"> evas_object_image_native_surface_set(m_compositingObject, &nativeSurface);
</span><del>- return true;
-}
</del><span class="cx">
</span><del>-bool AcceleratedCompositingContext::canComposite()
-{
- return m_rootGraphicsLayer && m_textureMapper;
</del><ins>+ if (!evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context())) {
+ ERR("Failed to evas_gl_make_current.");
+ return;
+ }
+
+ evas_gl_api_get(m_evasGL.get())->glViewport(0, 0, size.width(), size.height());
+ evas_gl_api_get(m_evasGL.get())->glClearColor(1, 1, 1, 1);
+ evas_gl_api_get(m_evasGL.get())->glClear(GL_COLOR_BUFFER_BIT);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AcceleratedCompositingContext::flushAndRenderLayers()
</span><span class="cx"> {
</span><del>- if (!canComposite())
- return;
-
</del><span class="cx"> MainFrame& frame = EWKPrivate::corePage(m_view)->mainFrame();
</span><span class="cx"> if (!frame.contentRenderer() || !frame.view())
</span><span class="cx"> return;
</span><span class="cx"> frame.view()->updateLayoutAndStyleIfNeededRecursive();
</span><span class="cx">
</span><del>- if (!canComposite())
- return;
-
- if (!evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context()))
- return;
-
</del><span class="cx"> if (!flushPendingLayerChanges())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- compositeLayersToContext();
-
- if (toTextureMapperLayer(m_rootGraphicsLayer.get())->descendantsOrSelfHaveRunningAnimations() && !m_syncTimer.isActive())
- m_syncTimer.startOneShot(1 / compositingFrameRate);
</del><ins>+ if (m_isAccelerated)
+ paintToCurrentGLContext();
+ else
+ paintToGraphicsContext();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool AcceleratedCompositingContext::flushPendingLayerChanges()
</span><span class="cx"> {
</span><del>- m_rootGraphicsLayer->flushCompositingStateForThisLayerOnly();
</del><ins>+ if (!m_rootLayer)
+ return false;
+
+ m_rootLayer->flushCompositingStateForThisLayerOnly();
</ins><span class="cx"> return EWKPrivate::corePage(m_view)->mainFrame().view()->flushCompositingStateIncludingSubframes();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AcceleratedCompositingContext::compositeLayersToContext()
</del><ins>+void AcceleratedCompositingContext::paintToGraphicsContext()
</ins><span class="cx"> {
</span><del>- Evas_Coord width = 0;
- Evas_Coord height = 0;
- evas_object_geometry_get(m_view, 0, 0, &width, &height);
</del><ins>+ if (!m_textureMapper)
+ m_textureMapper = TextureMapper::create(TextureMapper::SoftwareMode);
</ins><span class="cx">
</span><del>- evas_gl_api_get(m_evasGL.get())->glViewport(0, 0, width, height);
- evas_gl_api_get(m_evasGL.get())->glClear(GL_COLOR_BUFFER_BIT);
</del><ins>+ RefPtr<cairo_surface_t> surface = createSurfaceForImage(m_compositingObject);
+ if (!surface)
+ return;
</ins><span class="cx">
</span><del>- m_textureMapper->beginPainting();
- 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();
</del><ins>+ PlatformContextCairo platformContext(cairo_create(surface.get()));
+ GraphicsContext context(&platformContext);
+ m_textureMapper->setGraphicsContext(&context);
+
+ compositeLayers();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void AcceleratedCompositingContext::attachRootGraphicsLayer(GraphicsLayer* rootLayer)
</del><ins>+void AcceleratedCompositingContext::paintToCurrentGLContext()
</ins><span class="cx"> {
</span><del>- if (!rootLayer) {
- m_rootGraphicsLayer = nullptr;
- return;
- }
-
</del><span class="cx"> if (!m_textureMapper) {
</span><del>- evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context());
- m_textureMapper = TextureMapperGL::create();
</del><ins>+ m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
+ static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- m_rootGraphicsLayer = GraphicsLayer::create(0, 0);
- m_rootGraphicsLayer->addChild(rootLayer);
- m_rootGraphicsLayer->setDrawsContent(false);
- m_rootGraphicsLayer->setMasksToBounds(false);
- m_rootGraphicsLayer->setSize(IntSize(1, 1));
</del><ins>+ if (!evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context()))
+ return;
</ins><span class="cx">
</span><del>- toTextureMapperLayer(m_rootGraphicsLayer.get())->setTextureMapper(m_textureMapper.get());
</del><ins>+ evas_gl_api_get(m_evasGL.get())->glViewport(0, 0, m_viewSize.width(), m_viewSize.height());
+ evas_gl_api_get(m_evasGL.get())->glClear(GL_COLOR_BUFFER_BIT);
</ins><span class="cx">
</span><del>- m_rootGraphicsLayer->flushCompositingStateForThisLayerOnly();
</del><ins>+ compositeLayers();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void AcceleratedCompositingContext::compositeLayers()
+{
+ TextureMapperLayer* currentRootLayer = toTextureMapperLayer(m_rootLayer);
+ if (!currentRootLayer)
+ return;
+
+ currentRootLayer->setTextureMapper(m_textureMapper.get());
+ currentRootLayer->applyAnimationsRecursively();
+
+ m_textureMapper->beginPainting();
+ m_textureMapper->beginClip(TransformationMatrix(), FloatRect(FloatPoint(), m_viewSize));
+ currentRootLayer->paint();
+ m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
+ m_textureMapper->endClip();
+ m_textureMapper->endPainting();
+
+ if (currentRootLayer->descendantsOrSelfHaveRunningAnimations() && !m_syncTimer.isActive())
+ m_syncTimer.startOneShot(1 / compositingFrameRate);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // USE(TEXTURE_MAPPER_GL)
</span></span></pre></div>
<a id="trunkSourceWebKiteflWebCoreSupportAcceleratedCompositingContextEflh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h (166636 => 166637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h        2014-04-02 09:14:36 UTC (rev 166636)
+++ trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h        2014-04-02 09:23:10 UTC (rev 166637)
</span><span class="lines">@@ -42,25 +42,23 @@
</span><span class="cx"> AcceleratedCompositingContext(Evas_Object* ewkView, Evas_Object* compositingObject);
</span><span class="cx"> ~AcceleratedCompositingContext();
</span><span class="cx">
</span><del>- bool initialize();
</del><ins>+ void setRootGraphicsLayer(GraphicsLayer* rootLayer) { m_rootLayer = rootLayer; }
+ void resize(const IntSize&);
+ void flushAndRenderLayers();
</ins><span class="cx">
</span><del>- bool resize(const IntSize&);
- void attachRootGraphicsLayer(GraphicsLayer* rootLayer);
</del><ins>+private:
+ void paintToGraphicsContext();
+ void paintToCurrentGLContext();
+ void compositeLayers();
</ins><span class="cx">
</span><del>- void flushAndRenderLayers();
</del><span class="cx"> bool flushPendingLayerChanges();
</span><del>- void compositeLayersToContext();
-
- bool canComposite();
-
</del><span class="cx"> void syncLayers(Timer<AcceleratedCompositingContext>*);
</span><span class="cx">
</span><del>-private:
</del><span class="cx"> Evas_Object* m_view;
</span><span class="cx"> Evas_Object* m_compositingObject;
</span><span class="cx">
</span><span class="cx"> OwnPtr<TextureMapper> m_textureMapper;
</span><del>- std::unique_ptr<GraphicsLayer> m_rootGraphicsLayer;
</del><ins>+ GraphicsLayer* m_rootLayer;
</ins><span class="cx"> Timer<AcceleratedCompositingContext> m_syncTimer;
</span><span class="cx">
</span><span class="cx"> EflUniquePtr<Evas_GL> m_evasGL;
</span><span class="lines">@@ -68,6 +66,9 @@
</span><span class="cx"> std::unique_ptr<EvasGLSurface> m_evasGLSurface;
</span><span class="cx">
</span><span class="cx"> TextureMapperFPSCounter m_fpsCounter;
</span><ins>+
+ IntSize m_viewSize;
+ bool m_isAccelerated;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_viewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (166636 => 166637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp        2014-04-02 09:14:36 UTC (rev 166636)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp        2014-04-02 09:23:10 UTC (rev 166637)
</span><span class="lines">@@ -255,8 +255,6 @@
</span><span class="cx"> WebCore::ViewportArguments viewportArguments;
</span><span class="cx"> Ewk_History* history;
</span><span class="cx"> std::unique_ptr<WebCore::AcceleratedCompositingContext> acceleratedCompositingContext;
</span><del>- bool isCompositingActive;
- RefPtr<Evas_Object> compositingObject;
</del><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="cx"> WebCore::ColorChooserClient* colorChooserClient;
</span><span class="cx"> #endif
</span><span class="lines">@@ -272,8 +270,6 @@
</span><span class="cx"> size_t count;
</span><span class="cx"> size_t allocated;
</span><span class="cx"> } repaints;
</span><del>- WTF::Vector<WebCore::IntRect> m_rectsToScroll;
- WTF::Vector<WebCore::IntSize> m_scrollOffsets;
</del><span class="cx"> unsigned int imh; /**< input method hints */
</span><span class="cx"> struct {
</span><span class="cx"> bool viewCleared : 1;
</span><span class="lines">@@ -472,12 +468,6 @@
</span><span class="cx"> _ewk_view_repaints_resize(priv, ewkViewRepaintsSizeMaximumFree);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void _ewk_view_scrolls_flush(Ewk_View_Private_Data* priv)
-{
- priv->m_scrollOffsets.clear();
- priv->m_rectsToScroll.clear();
-}
-
</del><span class="cx"> // Default Event Handling //////////////////////////////////////////////
</span><span class="cx"> static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
</span><span class="cx"> {
</span><span class="lines">@@ -747,6 +737,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> pageSettings.setInteractiveFormValidationEnabled(true);
</span><span class="cx"> pageSettings.setAcceleratedCompositingEnabled(true);
</span><ins>+ pageSettings.setForceCompositingMode(true);
</ins><span class="cx"> char* debugVisualsEnvironment = getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS");
</span><span class="cx"> bool showDebugVisuals = debugVisualsEnvironment && !strcmp(debugVisualsEnvironment, "1");
</span><span class="cx"> pageSettings.setShowDebugBorders(showDebugVisuals);
</span><span class="lines">@@ -834,8 +825,6 @@
</span><span class="cx"> priv->contextMenu = 0;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- priv->isCompositingActive = false;
-
</del><span class="cx"> return priv;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -878,6 +867,11 @@
</span><span class="cx"> delete priv;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static void _ewk_view_accelerated_compositing_cb(void* data, Evas_Object*)
+{
+ static_cast<WebCore::AcceleratedCompositingContext*>(data)->flushAndRenderLayers();
+}
+
</ins><span class="cx"> static void _ewk_view_smart_add(Evas_Object* ewkView)
</span><span class="cx"> {
</span><span class="cx"> const Evas_Smart* smart = evas_object_smart_smart_get(ewkView);
</span><span class="lines">@@ -910,23 +904,24 @@
</span><span class="cx">
</span><span class="cx"> EWK_VIEW_PRIV_GET(smartData, priv);
</span><span class="cx">
</span><del>- smartData->backing_store = evas_object_image_add(smartData->base.evas);
- if (EINA_UNLIKELY(!smartData->backing_store)) {
</del><ins>+ smartData->image = evas_object_image_add(smartData->base.evas);
+ if (EINA_UNLIKELY(!smartData->image)) {
</ins><span class="cx"> ERR("Could not create backing store object.");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(smartData->base.evas);
- const char* engine = ecore_evas_engine_name_get(ecoreEvas);
- if (!strncmp(engine, "opengl_x11", strlen("opengl_x11")))
- evas_object_image_content_hint_set(smartData->backing_store, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
</del><ins>+ evas_object_image_alpha_set(smartData->image, false);
+ evas_object_image_filled_set(smartData->image, true);
+ evas_object_image_smooth_scale_set(smartData->image, smartData->zoom_weak_smooth_scale);
+ evas_object_pass_events_set(smartData->image, true);
+ evas_object_smart_member_add(smartData->image, ewkView);
+ evas_object_show(smartData->image);
</ins><span class="cx">
</span><del>- evas_object_image_alpha_set(smartData->backing_store, false);
- evas_object_image_smooth_scale_set(smartData->backing_store, smartData->zoom_weak_smooth_scale);
- evas_object_pass_events_set(smartData->backing_store, true);
- evas_object_smart_member_add(smartData->backing_store, ewkView);
- evas_object_show(smartData->backing_store);
</del><ins>+ priv->acceleratedCompositingContext = std::make_unique<WebCore::AcceleratedCompositingContext>(ewkView, smartData->image);
</ins><span class="cx">
</span><ins>+ // Set the pixel get callback.
+ evas_object_image_pixels_get_callback_set(smartData->image, _ewk_view_accelerated_compositing_cb, priv->acceleratedCompositingContext.get());
+
</ins><span class="cx"> smartData->events_rect = evas_object_rectangle_add(smartData->base.evas);
</span><span class="cx"> evas_object_color_set(smartData->events_rect, 0, 0, 0, 0);
</span><span class="cx"> evas_object_smart_member_add(smartData->events_rect, ewkView);
</span><span class="lines">@@ -981,34 +976,14 @@
</span><span class="cx"> EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
</span><span class="cx">
</span><span class="cx"> // these should be queued and processed in calculate as well!
</span><del>- evas_object_resize(smartData->backing_store, width, height);
- evas_object_image_size_set(smartData->backing_store, width, height);
</del><ins>+ evas_object_resize(smartData->image, width, height);
+ evas_object_image_size_set(smartData->image, width, height);
+ evas_object_image_fill_set(smartData->image, 0, 0, width, height);
</ins><span class="cx">
</span><del>- if (priv->compositingObject) {
- evas_object_resize(priv->compositingObject.get(), width, height);
- evas_object_image_size_set(priv->compositingObject.get(), width, height);
- evas_object_image_fill_set(priv->compositingObject.get(), 0, 0, width, height);
</del><ins>+ priv->acceleratedCompositingContext->resize(WebCore::IntSize(width, height));
</ins><span class="cx">
</span><del>- if (priv->acceleratedCompositingContext)
- priv->acceleratedCompositingContext->resize(WebCore::IntSize(width, height));
- }
-
</del><span class="cx"> smartData->changed.size = true;
</span><span class="cx"> _ewk_view_smart_changed(smartData);
</span><del>-
- if (smartData->animated_zoom.zoom.current < std::numeric_limits<float>::epsilon()) {
- Evas_Object* clip = evas_object_clip_get(smartData->backing_store);
- Evas_Coord x, y, contentWidth, contentHeight;
- evas_object_image_fill_set(smartData->backing_store, 0, 0, width, height);
- evas_object_geometry_get(smartData->backing_store, &x, &y, 0, 0);
- evas_object_move(clip, x, y);
- ewk_frame_contents_size_get(smartData->main_frame, &contentWidth, &contentHeight);
- if (width > contentWidth)
- width = contentWidth;
- if (height > contentHeight)
- height = contentHeight;
- evas_object_resize(clip, width, height);
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord /*x*/, Evas_Coord /*y*/)
</span><span class="lines">@@ -1053,173 +1028,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline void _ewk_view_scroll_process(Ewk_View_Smart_Data* smartData, void* pixels, Evas_Coord width, Evas_Coord height, const WebCore::IntSize& scrollOffset, const WebCore::IntRect& rectToScroll)
-{
- int scrollX = rectToScroll.x();
- int scrollY = rectToScroll.y();
- int scrollWidth = rectToScroll.width();
- int scrollHeight = rectToScroll.height();
-
- if (abs(scrollOffset.width()) >= scrollWidth || abs(scrollOffset.height()) >= scrollHeight) {
- ewk_view_repaint_add(smartData->_priv, scrollX, scrollY, scrollWidth, scrollHeight);
- return;
- }
-
- if (scrollX < 0) {
- scrollWidth += scrollX;
- scrollX = 0;
- }
- if (scrollY < 0) {
- scrollHeight += scrollY;
- scrollY = 0;
- }
-
- if (scrollX + scrollWidth > width)
- scrollWidth = width - scrollX;
- if (scrollY + scrollHeight > height)
- scrollHeight = height - scrollY;
-
- if (scrollWidth <= 0 || scrollHeight <= 0)
- return;
-
- int sourceX = scrollOffset.width() < 0 ? abs(scrollOffset.width()) : 0;
- int sourceY = scrollOffset.height() < 0 ? abs(scrollOffset.height()) : 0;
- int destinationX = scrollOffset.width() < 0 ? 0 : scrollOffset.width();
- int destinationY = scrollOffset.height() < 0 ? 0 : scrollOffset.height();
- int copyWidth = scrollWidth - abs(scrollOffset.width());
- int copyHeight = scrollHeight - abs(scrollOffset.height());
- if (scrollOffset.width() || scrollOffset.height()) {
- _ewk_view_screen_move(static_cast<uint32_t*>(pixels), destinationX, destinationY, sourceX, sourceY, copyWidth, copyHeight, width);
- evas_object_image_data_update_add(smartData->backing_store, destinationX, destinationY, copyWidth, copyHeight);
- }
-
- Eina_Rectangle verticalUpdate;
- verticalUpdate.x = destinationX ? 0 : copyWidth - 1;
- verticalUpdate.y = 0;
- verticalUpdate.w = abs(scrollOffset.width());
- verticalUpdate.h = scrollHeight;
- if (verticalUpdate.w && verticalUpdate.h)
- ewk_view_repaint_add(smartData->_priv, verticalUpdate.x, verticalUpdate.y, verticalUpdate.w, verticalUpdate.h);
-
- Eina_Rectangle horizontalUpdate;
- horizontalUpdate.x = destinationX;
- horizontalUpdate.y = destinationY ? 0 : copyHeight - 1;
- horizontalUpdate.w = copyWidth;
- horizontalUpdate.h = abs(scrollOffset.height());
- if (horizontalUpdate.w && horizontalUpdate.h)
- ewk_view_repaint_add(smartData->_priv, horizontalUpdate.x, horizontalUpdate.y, horizontalUpdate.w, horizontalUpdate.h);
-}
-
-static void _ewk_view_smart_scrolls_process(Ewk_View_Smart_Data* smartData)
-{
- Evas_Coord imageWidth, imageHeight;
- const WTF::Vector<WebCore::IntSize>& scrollOffsets = smartData->_priv->m_scrollOffsets;
- const WTF::Vector<WebCore::IntRect>& rectsToScroll = smartData->_priv->m_rectsToScroll;
-
- if (!scrollOffsets.size())
- return;
-
- evas_object_image_size_get(smartData->backing_store, &imageWidth, &imageHeight);
-
- WebCore::IntRect rectToScroll(0, 0, imageWidth, imageHeight);
- WebCore::IntSize scrollOffset;
- for (size_t i = 0; i < scrollOffsets.size(); ++i) {
- rectToScroll.intersect(rectsToScroll[i]);
- scrollOffset += scrollOffsets[i];
- }
-
- if (scrollOffset.isZero())
- return;
-
- void* pixels = evas_object_image_data_get(smartData->backing_store, 1);
- _ewk_view_scroll_process(smartData, pixels, imageWidth, imageHeight, scrollOffset, rectToScroll);
-
- evas_object_image_data_set(smartData->backing_store, pixels);
-
- return;
-}
-
-static bool _ewk_view_smart_repaints_process(Ewk_View_Smart_Data* smartData)
-{
- EWK_VIEW_PRIV_GET(smartData, priv);
-
- if (smartData->animated_zoom.zoom.current < std::numeric_limits<float>::epsilon()) {
- Evas_Object* clip = evas_object_clip_get(smartData->backing_store);
-
- // reset effects of zoom_weak_set()
- evas_object_image_fill_set(smartData->backing_store, 0, 0, smartData->view.w, smartData->view.h);
- evas_object_move(clip, smartData->view.x, smartData->view.y);
-
- Evas_Coord width = smartData->view.w;
- Evas_Coord height = smartData->view.h;
-
- Evas_Coord centerWidth, centerHeight;
- ewk_frame_contents_size_get(smartData->main_frame, &centerWidth, &centerHeight);
- if (width > centerWidth)
- width = centerWidth;
-
- if (height > centerHeight)
- height = centerHeight;
-
- evas_object_resize(clip, width, height);
- }
-
- Evas_Coord imageWidth, imageHeight;
- evas_object_image_size_get(smartData->backing_store, &imageWidth, &imageHeight);
-
- Eina_Tiler* tiler = eina_tiler_new(imageWidth, imageHeight);
- if (!tiler) {
- ERR("could not create tiler %dx%d", imageWidth, imageHeight);
- return false;
- }
-
- ewk_view_layout_if_needed_recursive(priv);
-
- size_t count;
- const Eina_Rectangle* paintRequest = ewk_view_repaints_pop(priv, &count);
- const Eina_Rectangle* paintRequestEnd = paintRequest + count;
- for (; paintRequest < paintRequestEnd; paintRequest++)
- eina_tiler_rect_add(tiler, paintRequest);
-
- Eina_Iterator* iterator = eina_tiler_iterator_new(tiler);
- if (!iterator) {
- ERR("could not get iterator for tiler");
- eina_tiler_free(tiler);
- return false;
- }
-
-#if USE(TILED_BACKING_STORE)
- if (priv->page->mainFrame().tiledBackingStore())
- priv->page->mainFrame().tiledBackingStore()->coverWithTilesIfNeeded();
-#endif
-
- Ewk_Paint_Context* context = ewk_paint_context_from_image_new(smartData->backing_store);
- ewk_paint_context_save(context);
-
- Eina_Rectangle* rect;
- EINA_ITERATOR_FOREACH(iterator, rect) {
- ewk_view_paint(smartData->_priv, context, rect);
- evas_object_image_data_update_add(smartData->backing_store, rect->x, rect->y, rect->w, rect->h);
- }
-
-#if ENABLE(INSPECTOR)
- WebCore::Page* page = EWKPrivate::corePage(smartData->self);
- if (page) {
- WebCore::InspectorController& controller = page->inspectorController();
- if (controller.highlightedNode())
- controller.drawHighlight(*context->graphicContext);
- }
-#endif
-
- ewk_paint_context_restore(context);
- ewk_paint_context_free(context);
-
- eina_tiler_free(tiler);
- eina_iterator_free(iterator);
-
- return true;
-}
-
</del><span class="cx"> static void _ewk_view_smart_calculate(Evas_Object* ewkView)
</span><span class="cx"> {
</span><span class="cx"> EWK_VIEW_SD_GET(ewkView, smartData);
</span><span class="lines">@@ -1258,7 +1066,7 @@
</span><span class="cx">
</span><span class="cx"> if (smartData->changed.position && ((x != smartData->view.x) || (y != smartData->view.y))) {
</span><span class="cx"> evas_object_move(smartData->main_frame, x, y);
</span><del>- evas_object_move(smartData->backing_store, x, y);
</del><ins>+ evas_object_move(smartData->image, x, y);
</ins><span class="cx"> evas_object_move(smartData->events_rect, x, y);
</span><span class="cx"> smartData->changed.frame_rect = true;
</span><span class="cx"> smartData->view.x = x;
</span><span class="lines">@@ -1266,12 +1074,6 @@
</span><span class="cx"> }
</span><span class="cx"> smartData->changed.position = false;
</span><span class="cx">
</span><del>- _ewk_view_smart_scrolls_process(smartData);
- _ewk_view_scrolls_flush(priv);
-
- if (!_ewk_view_smart_repaints_process(smartData))
- ERR("failed to process repaints.");
-
</del><span class="cx"> if (smartData->changed.frame_rect) {
</span><span class="cx"> priv->page->mainFrame().view()->frameRectsChanged();
</span><span class="cx"> smartData->changed.frame_rect = false;
</span><span class="lines">@@ -1285,10 +1087,7 @@
</span><span class="cx">
</span><span class="cx"> if (evas_object_clipees_get(smartData->base.clipper))
</span><span class="cx"> evas_object_show(smartData->base.clipper);
</span><del>- evas_object_show(smartData->backing_store);
-
- if (priv->isCompositingActive)
- evas_object_show(priv->compositingObject.get());
</del><ins>+ evas_object_show(smartData->image);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void _ewk_view_smart_hide(Evas_Object* ewkView)
</span><span class="lines">@@ -1297,10 +1096,7 @@
</span><span class="cx"> EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
</span><span class="cx">
</span><span class="cx"> evas_object_hide(smartData->base.clipper);
</span><del>- evas_object_hide(smartData->backing_store);
-
- if (priv->isCompositingActive)
- evas_object_hide(priv->compositingObject.get());
</del><ins>+ evas_object_hide(smartData->image);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data*, int /*width*/, int /*height*/)
</span><span class="lines">@@ -1340,7 +1136,6 @@
</span><span class="cx"> {
</span><span class="cx"> EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
</span><span class="cx"> _ewk_view_repaints_flush(priv);
</span><del>- _ewk_view_scrolls_flush(priv);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* smartData)
</span><span class="lines">@@ -1381,7 +1176,7 @@
</span><span class="cx"> Evas_Coord w = smartData->view.w * scale;
</span><span class="cx"> Evas_Coord h = smartData->view.h * scale;
</span><span class="cx"> Evas_Coord deltaX, deltaY, contentWidth, contentHeight;
</span><del>- Evas_Object* clip = evas_object_clip_get(smartData->backing_store);
</del><ins>+ Evas_Object* clip = evas_object_clip_get(smartData->image);
</ins><span class="cx">
</span><span class="cx"> ewk_frame_contents_size_get(smartData->main_frame, &contentWidth, &contentHeight);
</span><span class="cx"> if (smartData->view.w > 0 && smartData->view.h > 0) {
</span><span class="lines">@@ -1392,7 +1187,7 @@
</span><span class="cx"> deltaY = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- evas_object_image_fill_set(smartData->backing_store, centerX + deltaX, centerY + deltaY, w, h);
</del><ins>+ evas_object_image_fill_set(smartData->image, centerX + deltaX, centerY + deltaY, w, h);
</ins><span class="cx">
</span><span class="cx"> if (smartData->view.w > 0 && smartData->view.h > 0) {
</span><span class="cx"> deltaX = ((smartData->view.w - w) * centerX) / smartData->view.w;
</span><span class="lines">@@ -1414,7 +1209,7 @@
</span><span class="cx">
</span><span class="cx"> static void _ewk_view_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data* smartData, Eina_Bool smooth_scale)
</span><span class="cx"> {
</span><del>- evas_object_image_smooth_scale_set(smartData->backing_store, smooth_scale);
</del><ins>+ evas_object_image_smooth_scale_set(smartData->image, smooth_scale);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Eina_Bool _ewk_view_zoom_animator_cb(void* data)
</span><span class="lines">@@ -1698,7 +1493,7 @@
</span><span class="cx"> smartData->bg_color.b = blue;
</span><span class="cx"> smartData->bg_color.a = alpha;
</span><span class="cx">
</span><del>- evas_object_image_alpha_set(smartData->backing_store, alpha < 255);
</del><ins>+ evas_object_image_alpha_set(smartData->image, alpha < 255);
</ins><span class="cx">
</span><span class="cx"> WebCore::FrameView* view = smartData->_priv->page->mainFrame().view();
</span><span class="cx"> if (view) {
</span><span class="lines">@@ -2939,15 +2734,6 @@
</span><span class="cx"> view->updateLayoutAndStyleIfNeededRecursive();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ewk_view_scrolls_process(Ewk_View_Smart_Data* smartData)
-{
- EINA_SAFETY_ON_NULL_RETURN(smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- _ewk_view_smart_scrolls_process(smartData);
- _ewk_view_scrolls_flush(priv);
-}
-
</del><span class="cx"> /* internal methods ****************************************************/
</span><span class="cx"> /**
</span><span class="cx"> * @internal
</span><span class="lines">@@ -3743,15 +3529,7 @@
</span><span class="cx"> EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
</span><span class="cx"> EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
</span><span class="cx">
</span><del>- priv->m_rectsToScroll.append(rectToScroll);
- priv->m_scrollOffsets.append(delta);
-
- for (size_t i = 0; i < priv->repaints.count; ++i) {
- priv->repaints.array[i].x += delta.width();
- priv->repaints.array[i].y += delta.height();
- }
-
- _ewk_view_smart_changed(smartData);
</del><ins>+ ewk_view_mark_for_sync(ewkView);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -4626,79 +4404,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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->flushAndRenderLayers();
-}
-
-bool _ewk_view_accelerated_compositing_context_create_if_needed(Evas_Object* ewkView)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
-
- 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;
-}
-
-void _ewk_view_accelerated_compositing_object_create_if_needed(Evas_Object* ewkView)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- if (!priv->compositingObject) {
- priv->compositingObject = adoptRef(evas_object_image_add(smartData->base.evas));
-
- evas_object_pass_events_set(priv->compositingObject.get(), true); // Just for rendering, ignore events.
- evas_object_image_alpha_set(priv->compositingObject.get(), true);
- evas_object_image_content_hint_set(priv->compositingObject.get(), EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
-
- // Set the pixel get callback.
- evas_object_image_pixels_get_callback_set(priv->compositingObject.get(), _ewk_view_accelerated_compositing_cb, priv);
-
- evas_object_smart_member_add(priv->compositingObject.get(), ewkView);
- }
-
- evas_object_image_size_set(priv->compositingObject.get(), smartData->view.w, smartData->view.h);
- evas_object_image_fill_set(priv->compositingObject.get(), 0, 0, smartData->view.w, smartData->view.h);
-
- evas_object_move(priv->compositingObject.get(), smartData->view.x, smartData->view.y);
- evas_object_resize(priv->compositingObject.get(), smartData->view.w, smartData->view.h);
- evas_object_hide(priv->compositingObject.get());
-}
-
</del><span class="cx"> void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer)
</span><span class="cx"> {
</span><span class="cx"> EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
</span><span class="cx"> EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
</span><span class="cx">
</span><del>- bool active = !!rootLayer;
- if (priv->isCompositingActive == active)
- return;
-
- priv->isCompositingActive = active;
-
- if (priv->isCompositingActive) {
- _ewk_view_accelerated_compositing_object_create_if_needed(ewkView);
- if (_ewk_view_accelerated_compositing_context_create_if_needed(ewkView))
- evas_object_show(priv->compositingObject.get());
- else
- priv->isCompositingActive = false;
- }
-
- if (!priv->isCompositingActive)
- evas_object_hide(priv->compositingObject.get());
-
- if (priv->acceleratedCompositingContext)
- priv->acceleratedCompositingContext->attachRootGraphicsLayer(rootLayer);
</del><ins>+ priv->acceleratedCompositingContext->setRootGraphicsLayer(rootLayer);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ewk_view_mark_for_sync(Evas_Object* ewkView)
</span><span class="lines">@@ -4708,7 +4419,7 @@
</span><span class="cx">
</span><span class="cx"> // Mark the image as "dirty" meaning it needs an update next time evas renders.
</span><span class="cx"> // It will call the pixel get callback then.
</span><del>- evas_object_image_pixels_dirty_set(priv->compositingObject.get(), true);
</del><ins>+ evas_object_image_pixels_dirty_set(smartData->image, true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ewk_view_cursor_set(Evas_Object* ewkView, const WebCore::Cursor& cursor)
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_viewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_view.h (166636 => 166637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_view.h        2014-04-02 09:14:36 UTC (rev 166636)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.h        2014-04-02 09:23:10 UTC (rev 166637)
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx"> const Ewk_View_Smart_Class *api; /**< Reference to casted class instance. */
</span><span class="cx"> Evas_Object *self; /**< Reference to owner object. */
</span><span class="cx"> Evas_Object *main_frame; /**< Reference to main frame object. */
</span><del>- Evas_Object *backing_store; /**< Reference to backing store. */
</del><ins>+ Evas_Object *image; /**< Reference to evas_object_image for drawing web content */
</ins><span class="cx"> Evas_Object *events_rect; /**< The rectangle that receives mouse events. */
</span><span class="cx"> Ewk_View_Private_Data *_priv; /**< Should @b never be accessed, c++ stuff. */
</span><span class="cx"> struct {
</span></span></pre>
</div>
</div>
</body>
</html>