Changeset 165314 in webkit


Ignore:
Timestamp:
Mar 7, 2014 6:23:50 PM (10 years ago)
Author:
ryuan.choi@samsung.com
Message:

[EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.
https://bugs.webkit.org/show_bug.cgi?id=129676

Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2014-03-07
Reviewed by Gyuyoung Kim.

TextureMapperGL has its own GraphicsContext3D created by createForCurrentGLContext().
So AcceleratedCompositingContext doesn't need to create and set it to TextureMapperGL.

We now should do 'makeCurrentContext' with a platform specific context before createForCurrentGLContext().
This patch removes GraphicsContext3D related codes in AcceleratedCompositingContext
and adds EvasGLContext/Surface to it instead.

  • WebCoreSupport/AcceleratedCompositingContextEfl.cpp:

(WebCore::AcceleratedCompositingContext::initialize):
(WebCore::AcceleratedCompositingContext::resize):
(WebCore::AcceleratedCompositingContext::renderLayers):

  • WebCoreSupport/AcceleratedCompositingContextEfl.h:
  • ewk/ewk_view.cpp:
  • ewk/ewk_view_private.h:
Location:
trunk/Source/WebKit/efl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r165094 r165314  
     12014-03-07  Hyowon Kim  <hw1008.kim@samsung.com>
     2
     3        [EFL] Replace GraphicsContext3D with Evas_GL in AcceleratedCompositingContext.
     4        https://bugs.webkit.org/show_bug.cgi?id=129676
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        TextureMapperGL has its own GraphicsContext3D created by createForCurrentGLContext().
     9        So AcceleratedCompositingContext doesn't need to create and set it to TextureMapperGL.
     10
     11        We now should do 'makeCurrentContext' with a platform specific context before createForCurrentGLContext().
     12        This patch removes GraphicsContext3D related codes in AcceleratedCompositingContext
     13        and adds EvasGLContext/Surface to it instead.
     14
     15        * WebCoreSupport/AcceleratedCompositingContextEfl.cpp:
     16        (WebCore::AcceleratedCompositingContext::initialize):
     17        (WebCore::AcceleratedCompositingContext::resize):
     18        (WebCore::AcceleratedCompositingContext::renderLayers):
     19        * WebCoreSupport/AcceleratedCompositingContextEfl.h:
     20        * ewk/ewk_view.cpp:
     21        * ewk/ewk_view_private.h:
     22
    1232014-03-04  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp

    r163761 r165314  
    2323
    2424#include "AcceleratedCompositingContextEfl.h"
    25 
    2625#include "FrameView.h"
    27 #include "GraphicsContext3D.h"
    2826#include "GraphicsLayerTextureMapper.h"
    2927#include "HostWindow.h"
     
    6058        return false;
    6159
    62     m_context3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), hostWindow, WebCore::GraphicsContext3D::RenderDirectlyToHostWindow);
    63     if (!m_context3D)
     60    m_evasGL = adoptPtr(evas_gl_new(evas_object_evas_get(m_view)));
     61    if (!m_evasGL)
     62        return false;
     63
     64    m_evasGLContext = EvasGLContext::create(m_evasGL.get());
     65    if (!m_evasGLContext)
     66        return false;
     67
     68    Evas_Coord width = 0;
     69    Evas_Coord height = 0;
     70    evas_object_geometry_get(m_view, 0, 0, &width, &height);
     71
     72    IntSize webViewSize(width, height);
     73    if (webViewSize.isEmpty())
     74        return false;
     75
     76    return resize(webViewSize);
     77}
     78
     79bool AcceleratedCompositingContext::resize(const IntSize& size)
     80{
     81    static Evas_GL_Config evasGLConfig = {
     82        EVAS_GL_RGBA_8888,
     83        EVAS_GL_DEPTH_BIT_8,
     84        EVAS_GL_STENCIL_NONE,
     85        EVAS_GL_OPTIONS_NONE,
     86        EVAS_GL_MULTISAMPLE_NONE
     87    };
     88
     89    m_evasGLSurface = EvasGLSurface::create(m_evasGL.get(), &evasGLConfig, size);
     90    if (!m_evasGLSurface)
    6491        return false;
    6592
     
    80107        return;
    81108
    82     if (!m_context3D->makeContextCurrent())
     109    if (!evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context()))
    83110        return;
    84111
    85     int width = 0;
    86     int height = 0;
     112    Evas_Coord width = 0;
     113    Evas_Coord height = 0;
    87114    evas_object_geometry_get(m_view, 0, 0, &width, &height);
    88     m_context3D->viewport(0, 0, width, height);
     115    evas_gl_api_get(m_evasGL.get())->glViewport(0, 0, width, height);
    89116
    90117    m_textureMapper->beginPainting();
     
    115142}
    116143
    117 GraphicsContext3D* AcceleratedCompositingContext::context()
    118 {
    119     return m_context3D.get();
    120 }
    121 
    122144} // namespace WebCore
    123145
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h

    r163079 r165314  
    2121#define AcceleratedCompositingContextEfl_h
    2222
     23#if USE(TEXTURE_MAPPER_GL)
     24#include "EvasGLContext.h"
     25#include "EvasGLSurface.h"
     26#include "TextureMapperFPSCounter.h"
    2327#include <wtf/Noncopyable.h>
    24 #include <wtf/PassOwnPtr.h>
    25 
    26 #if USE(TEXTURE_MAPPER_GL)
    27 
    28 #include "TextureMapperFPSCounter.h"
    29 #include "ewk_private.h"
     28#include <wtf/OwnPtr.h>
    3029
    3130namespace WebCore {
    3231
     32class GraphicsLayer;
    3333class HostWindow;
    3434class TextureMapper;
     
    4444    virtual void renderLayers();
    4545    virtual void attachRootGraphicsLayer(GraphicsLayer* rootLayer);
    46     virtual GraphicsContext3D* context();
    4746
    4847private:
     
    5049
    5150    virtual bool initialize(HostWindow*);
     51
     52    bool resize(const IntSize&);
    5253
    5354    Evas_Object* m_view;
     
    5758    TextureMapperLayer* m_rootTextureMapperLayer;
    5859
    59     RefPtr<GraphicsContext3D> m_context3D;
     60    OwnPtr<Evas_GL> m_evasGL;
     61    OwnPtr<EvasGLContext> m_evasGLContext;
     62    OwnPtr<EvasGLSurface> m_evasGLSurface;
     63
    6064    TextureMapperFPSCounter m_fpsCounter;
    6165};
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r164168 r165314  
    46584658}
    46594659
    4660 WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView)
    4661 {
    4662     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
    4663     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
    4664 
    4665     _ewk_view_accelerated_compositing_context_create_if_needed(ewkView);
    4666     return priv->acceleratedCompositingContext->context();
    4667 }
    4668 
    46694660void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer)
    46704661{
  • trunk/Source/WebKit/efl/ewk/ewk_view_private.h

    r163079 r165314  
    151151
    152152bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect);
    153 WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView);
    154153void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer);
    155154void ewk_view_mark_for_sync(Evas_Object* ewkView);
Note: See TracChangeset for help on using the changeset viewer.