Changeset 166889 in webkit


Ignore:
Timestamp:
Apr 7, 2014 3:21:58 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
https://bugs.webkit.org/show_bug.cgi?id=131276

Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2014-04-07
Reviewed by Darin Adler.

Source/WebCore:

Replace uses of OwnPtr and PassOwnPtr in code under WebCore/platform/graphics/
opengl, texmap, transforms and efl with std::unique_ptr.

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore::WebGLRenderingContext::initializeNewContext):

  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/GraphicsContext3DPrivate.cpp:

(WebCore::GraphicsContext3DPrivate::create): Deleted.

  • platform/graphics/GraphicsContext3DPrivate.h:
  • platform/graphics/cairo/GraphicsContext3DCairo.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):

  • platform/graphics/efl/EvasGLContext.h:
  • platform/graphics/efl/EvasGLSurface.h:
  • platform/graphics/efl/GraphicsContext3DEfl.cpp:

(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):

  • platform/graphics/efl/GraphicsContext3DPrivate.cpp:

(WebCore::GraphicsContext3DPrivate::create):
(WebCore::GraphicsContext3DPrivate::setContextLostCallback):

  • platform/graphics/efl/GraphicsContext3DPrivate.h:
  • platform/graphics/mac/GraphicsContext3DMac.mm:

(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):

  • platform/graphics/opengl/Extensions3DOpenGLES.cpp:

(WebCore::Extensions3DOpenGLES::setEXTContextLostCallback):

  • platform/graphics/opengl/Extensions3DOpenGLES.h:
  • platform/graphics/opengl/GLPlatformContext.cpp:

(WebCore::createOffScreenContext):
(WebCore::GLPlatformContext::createContext):

  • platform/graphics/opengl/GLPlatformContext.h:
  • platform/graphics/opengl/GLPlatformSurface.cpp:

(WebCore::GLPlatformSurface::createOffScreenSurface):

  • platform/graphics/opengl/GLPlatformSurface.h:
  • platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
  • platform/graphics/surfaces/egl/EGLSurface.cpp:

(WebCore::EGLOffScreenSurface::createOffScreenSurface):

  • platform/graphics/surfaces/egl/EGLSurface.h:
  • platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:

(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):

  • platform/graphics/texmap/GraphicsLayerTextureMapper.h:
  • platform/graphics/texmap/TextureMapper.cpp:

(WebCore::TextureMapper::create):
(WebCore::TextureMapper::TextureMapper):

  • platform/graphics/texmap/TextureMapper.h:

(WebCore::TextureMapper::platformCreateAccelerated):

  • platform/graphics/texmap/TextureMapperGL.cpp:

(WebCore::TextureMapper::platformCreateAccelerated):

  • platform/graphics/texmap/TextureMapperGL.h:

(WebCore::TextureMapperGL::create): Deleted.

  • platform/graphics/texmap/TextureMapperImageBuffer.h:

(WebCore::TextureMapperImageBuffer::TextureMapperImageBuffer):
(WebCore::TextureMapperImageBuffer::create): Deleted.

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:

(WebCore::CoordinatedGraphicsScene::purgeGLResources):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
  • platform/graphics/transforms/TransformState.cpp:

(WebCore::TransformState::operator=):
(WebCore::TransformState::applyTransform):

  • platform/graphics/transforms/TransformState.h:
  • platform/graphics/win/GraphicsContext3DWin.cpp:

(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):

Source/WebKit/efl:

Replace uses of OwnPtr for TextureMapper in AcceleratedCompositingContextEfl with std::unique_ptr.

  • WebCoreSupport/AcceleratedCompositingContextEfl.h:

Source/WebKit/gtk:

Replace uses of OwnPtr for TextureMapper in AcceleratedCompositingContext with std::unique_ptr.

  • WebCoreSupport/AcceleratedCompositingContext.h:

Source/WebKit2:

Replace uses of OwnPtr for TextureMapper in LayerTreeHostGtk with std::unique_ptr.

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
Location:
trunk/Source
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166886 r166889  
     12014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
     2
     3        Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
     4        https://bugs.webkit.org/show_bug.cgi?id=131276
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace uses of OwnPtr and PassOwnPtr in code under WebCore/platform/graphics/
     9        opengl, texmap, transforms and efl with std::unique_ptr.
     10
     11        * html/canvas/WebGLRenderingContext.cpp:
     12        (WebCore::WebGLRenderingContext::initializeNewContext):
     13        * platform/graphics/GraphicsContext3D.h:
     14        * platform/graphics/GraphicsContext3DPrivate.cpp:
     15        (WebCore::GraphicsContext3DPrivate::create): Deleted.
     16        * platform/graphics/GraphicsContext3DPrivate.h:
     17        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
     18        (WebCore::GraphicsContext3D::GraphicsContext3D):
     19        (WebCore::GraphicsContext3D::setContextLostCallback):
     20        (WebCore::GraphicsContext3D::setErrorMessageCallback):
     21        * platform/graphics/efl/EvasGLContext.h:
     22        * platform/graphics/efl/EvasGLSurface.h:
     23        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
     24        (WebCore::GraphicsContext3D::setContextLostCallback):
     25        (WebCore::GraphicsContext3D::setErrorMessageCallback):
     26        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
     27        (WebCore::GraphicsContext3DPrivate::create):
     28        (WebCore::GraphicsContext3DPrivate::setContextLostCallback):
     29        * platform/graphics/efl/GraphicsContext3DPrivate.h:
     30        * platform/graphics/mac/GraphicsContext3DMac.mm:
     31        (WebCore::GraphicsContext3D::GraphicsContext3D):
     32        (WebCore::GraphicsContext3D::setContextLostCallback):
     33        (WebCore::GraphicsContext3D::setErrorMessageCallback):
     34        * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
     35        (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback):
     36        * platform/graphics/opengl/Extensions3DOpenGLES.h:
     37        * platform/graphics/opengl/GLPlatformContext.cpp:
     38        (WebCore::createOffScreenContext):
     39        (WebCore::GLPlatformContext::createContext):
     40        * platform/graphics/opengl/GLPlatformContext.h:
     41        * platform/graphics/opengl/GLPlatformSurface.cpp:
     42        (WebCore::GLPlatformSurface::createOffScreenSurface):
     43        * platform/graphics/opengl/GLPlatformSurface.h:
     44        * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
     45        * platform/graphics/surfaces/egl/EGLSurface.cpp:
     46        (WebCore::EGLOffScreenSurface::createOffScreenSurface):
     47        * platform/graphics/surfaces/egl/EGLSurface.h:
     48        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     49        (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
     50        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
     51        * platform/graphics/texmap/TextureMapper.cpp:
     52        (WebCore::TextureMapper::create):
     53        (WebCore::TextureMapper::TextureMapper):
     54        * platform/graphics/texmap/TextureMapper.h:
     55        (WebCore::TextureMapper::platformCreateAccelerated):
     56        * platform/graphics/texmap/TextureMapperGL.cpp:
     57        (WebCore::TextureMapper::platformCreateAccelerated):
     58        * platform/graphics/texmap/TextureMapperGL.h:
     59        (WebCore::TextureMapperGL::create): Deleted.
     60        * platform/graphics/texmap/TextureMapperImageBuffer.h:
     61        (WebCore::TextureMapperImageBuffer::TextureMapperImageBuffer):
     62        (WebCore::TextureMapperImageBuffer::create): Deleted.
     63        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
     64        (WebCore::CoordinatedGraphicsScene::purgeGLResources):
     65        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
     66        * platform/graphics/transforms/TransformState.cpp:
     67        (WebCore::TransformState::operator=):
     68        (WebCore::TransformState::applyTransform):
     69        * platform/graphics/transforms/TransformState.h:
     70        * platform/graphics/win/GraphicsContext3DWin.cpp:
     71        (WebCore::GraphicsContext3D::GraphicsContext3D):
     72        (WebCore::GraphicsContext3D::setContextLostCallback):
     73        (WebCore::GraphicsContext3D::setErrorMessageCallback):
     74
    1752014-04-07  Tim Horton  <timothy_horton@apple.com>
    276
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r166803 r166889  
    589589    m_context->scissor(0, 0, canvasSize.width(), canvasSize.height());
    590590
    591     m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCallback(this)));
    592     m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMessageCallback(this)));
     591    m_context->setContextLostCallback(std::make_unique<WebGLRenderingContextLostCallback>(this));
     592    m_context->setErrorMessageCallback(std::make_unique<WebGLRenderingContextErrorMessageCallback>(this));
    593593}
    594594
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r166803 r166889  
    478478    };
    479479
    480     void setContextLostCallback(PassOwnPtr<ContextLostCallback>);
    481     void setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>);
     480    void setContextLostCallback(std::unique_ptr<ContextLostCallback>);
     481    void setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>);
    482482
    483483    static PassRefPtr<GraphicsContext3D> create(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
     
    11441144
    11451145    friend class GraphicsContext3DPrivate;
    1146     OwnPtr<GraphicsContext3DPrivate> m_private;
     1146    std::unique_ptr<GraphicsContext3DPrivate> m_private;
    11471147};
    11481148
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp

    r163079 r166889  
    4545
    4646namespace WebCore {
    47 
    48 PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle)
    49 {
    50     return adoptPtr(new GraphicsContext3DPrivate(context, renderStyle));
    51 }
    5247
    5348GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle)
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h

    r163079 r166889  
    3737{
    3838public:
    39     static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, GraphicsContext3D::RenderStyle);
     39    GraphicsContext3DPrivate(GraphicsContext3D*, GraphicsContext3D::RenderStyle);
    4040    ~GraphicsContext3DPrivate();
    4141    bool makeContextCurrent();
     
    4949
    5050private:
    51     GraphicsContext3DPrivate(GraphicsContext3D*, GraphicsContext3D::RenderStyle);
    52 
    5351    GraphicsContext3D* m_context;
    5452    OwnPtr<GLContext> m_glContext;
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp

    r165676 r166889  
    3939#include "RefPtrCairo.h"
    4040#include <cairo.h>
    41 #include <wtf/OwnPtr.h>
    42 #include <wtf/PassOwnPtr.h>
    4341
    4442#if PLATFORM(WIN)
     
    9088    , m_multisampleDepthStencilBuffer(0)
    9189    , m_multisampleColorBuffer(0)
    92     , m_private(GraphicsContext3DPrivate::create(this, renderStyle))
     90    , m_private(std::make_unique<GraphicsContext3DPrivate>(this, renderStyle))
    9391{
    9492    makeContextCurrent();
     
    273271}
    274272
    275 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
    276 {
    277 }
    278 
    279 void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
     273void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>)
     274{
     275}
     276
     277void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>)
    280278{
    281279}
  • trunk/Source/WebCore/platform/graphics/efl/EvasGLContext.h

    r166039 r166889  
    2828
    2929#include <Evas_GL.h>
    30 #include <wtf/PassOwnPtr.h>
    3130
    3231namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/efl/EvasGLSurface.h

    r166039 r166889  
    3030
    3131#include <Evas_GL.h>
    32 #include <wtf/PassOwnPtr.h>
    3332
    3433namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp

    r163079 r166889  
    198198}
    199199
    200 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback> callBack)
    201 {
    202     m_private->setContextLostCallback(callBack);
    203 }
    204 
    205 void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
     200void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback> callBack)
     201{
     202    m_private->setContextLostCallback(std::move(callBack));
     203}
     204
     205void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>)
    206206{
    207207    notImplemented();
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp

    r163761 r166889  
    2727namespace WebCore {
    2828
    29 PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, HostWindow* hostWindow)
    30 {
    31     OwnPtr<GraphicsContext3DPrivate> platformLayer = adoptPtr(new GraphicsContext3DPrivate(context, hostWindow));
     29std::unique_ptr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, HostWindow* hostWindow)
     30{
     31    std::unique_ptr<GraphicsContext3DPrivate> platformLayer = std::make_unique<GraphicsContext3DPrivate>(context, hostWindow);
    3232
    3333    if (platformLayer && platformLayer->initialize())
    34         return platformLayer.release();
     34        return platformLayer;
    3535
    3636    return nullptr;
     
    106106}
    107107
    108 void GraphicsContext3DPrivate::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callBack)
    109 {
    110     m_contextLostCallback = callBack;
     108void GraphicsContext3DPrivate::setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback> callBack)
     109{
     110    m_contextLostCallback = std::move(callBack);
    111111}
    112112
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h

    r163761 r166889  
    2929
    3030#include "GLPlatformContext.h"
    31 #include <wtf/PassOwnPtr.h>
    3231
    3332namespace WebCore {
     
    3837{
    3938public:
    40     static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, HostWindow*);
     39    static std::unique_ptr<GraphicsContext3DPrivate> create(GraphicsContext3D*, HostWindow*);
     40
     41    GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*);
    4142    ~GraphicsContext3DPrivate();
    4243
    4344    PlatformGraphicsContext3D platformGraphicsContext3D() const;
    44     void setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback>);
     45    void setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>);
    4546#if USE(TEXTURE_MAPPER_GL)
    4647    virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
     
    6768#endif
    6869
    69     GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*);
    7070    bool initialize();
    7171    void createGraphicsSurface();
     
    7575    GraphicsContext3D* m_context;
    7676    HostWindow* m_hostWindow;
    77     OwnPtr<GLPlatformContext> m_offScreenContext;
    78     OwnPtr<GLPlatformSurface> m_offScreenSurface;
     77    std::unique_ptr<GLPlatformContext> m_offScreenContext;
     78    std::unique_ptr<GLPlatformSurface> m_offScreenSurface;
    7979#if USE(GRAPHICS_SURFACE)
    8080    GraphicsSurfaceToken m_surfaceHandle;
     
    8383    PendingSurfaceOperation m_surfaceOperation : 3;
    8484#endif
    85     OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
     85    std::unique_ptr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
    8686    ListHashSet<GC3Denum> m_syntheticErrors;
    8787    IntSize m_size;
  • trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm

    r165865 r166889  
    133133    , m_multisampleDepthStencilBuffer(0)
    134134    , m_multisampleColorBuffer(0)
    135     , m_private(adoptPtr(new GraphicsContext3DPrivate(this)))
     135    , m_private(std::make_unique<GraphicsContext3DPrivate>(this))
    136136{
    137137    UNUSED_PARAM(hostWindow);
     
    364364}
    365365
    366 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
    367 {
    368 }
    369 
    370 void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
     366void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>)
     367{
     368}
     369
     370void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>)
    371371{
    372372}
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp

    r165688 r166889  
    186186}
    187187
    188 void Extensions3DOpenGLES::setEXTContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
    189 {
    190     m_contextLostCallback = callback;
     188void Extensions3DOpenGLES::setEXTContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback> callback)
     189{
     190    m_contextLostCallback = std::move(callback);
    191191}
    192192
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h

    r164468 r166889  
    8686    // EXT Robustness - reset
    8787    virtual int getGraphicsResetStatusARB();
    88     void setEXTContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback>);
     88    void setEXTContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>);
    8989
    9090    // EXT Robustness - etc
     
    121121    PFNGLDRAWELEMENTSINSTANCEDANGLEPROC m_glDrawElementsInstancedANGLE;
    122122
    123 
    124     OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
     123    std::unique_ptr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
    125124};
    126125
  • trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp

    r163079 r166889  
    6262};
    6363
    64 static PassOwnPtr<GLPlatformContext> createOffScreenContext()
    65 {
    66 #if USE(GLX)
    67     return adoptPtr(new GLXOffScreenContext());
    68 #elif USE(EGL)
    69     return adoptPtr(new EGLOffScreenContext());
     64static std::unique_ptr<GLPlatformContext> createOffScreenContext()
     65{
     66#if USE(GLX)
     67    return std::make_unique<GLXOffScreenContext>();
     68#elif USE(EGL)
     69    return std::make_unique<EGLOffScreenContext>();
    7070#else
    7171    return nullptr;
     
    101101}
    102102
    103 PassOwnPtr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D::RenderStyle renderStyle)
     103std::unique_ptr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D::RenderStyle renderStyle)
    104104{
    105105#if !USE(OPENGL_ES_2)
     
    110110    switch (renderStyle) {
    111111    case GraphicsContext3D::RenderOffscreen:
    112         if (OwnPtr<GLPlatformContext> context = createOffScreenContext())
    113             return context.release();
    114         break;
     112        return createOffScreenContext();
    115113    case GraphicsContext3D::RenderToCurrentGLContext:
    116         if (OwnPtr<GLPlatformContext> context = adoptPtr(new GLCurrentContextWrapper()))
    117             return context.release();
    118         break;
     114        return std::make_unique<GLCurrentContextWrapper>();
    119115    case GraphicsContext3D::RenderDirectlyToHostWindow:
    120116        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.h

    r163079 r166889  
    3131#include "GraphicsContext3D.h"
    3232#include <wtf/Noncopyable.h>
    33 #include <wtf/PassOwnPtr.h>
    3433
    3534// Encapsulates an OpenGL context, hiding platform specific management.
     
    4847    };
    4948
    50     static PassOwnPtr<GLPlatformContext> createContext(GraphicsContext3D::RenderStyle);
     49    static std::unique_ptr<GLPlatformContext> createContext(GraphicsContext3D::RenderStyle);
    5150
    5251    static bool supportsGLExtension(const String&);
  • trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp

    r163079 r166889  
    4141static GLPlatformSurface* m_currentDrawable = 0;
    4242
    43 PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)
     43std::unique_ptr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)
    4444{
    45     OwnPtr<GLPlatformSurface> surface;
     45    std::unique_ptr<GLPlatformSurface> surface;
    4646#if USE(GLX)
    47     surface = adoptPtr(new GLXOffScreenSurface(attributes));
     47    surface = std::make_unique<GLXOffScreenSurface>(attributes);
    4848#elif USE(EGL) && USE(GRAPHICS_SURFACE)
    4949    surface = EGLOffScreenSurface::createOffScreenSurface(attributes);
     
    5454
    5555    if (surface && surface->drawable())
    56         return surface.release();
     56        return surface;
    5757
    5858    return nullptr;
  • trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h

    r163079 r166889  
    4747    typedef unsigned SurfaceAttributes;
    4848    // Creates a GL surface used for offscreen rendering.
    49     static PassOwnPtr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes = GLPlatformSurface::Default);
     49    static std::unique_ptr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes = GLPlatformSurface::Default);
    5050
    5151    virtual ~GLPlatformSurface();
  • trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp

    r156700 r166889  
    152152    PlatformBufferHandle m_sharedHandle;
    153153    OwnPtr<GLTransportSurfaceClient> m_client;
    154     OwnPtr<GLPlatformContext> m_sharedContext;
     154    std::unique_ptr<GLPlatformContext> m_sharedContext;
    155155    OwnPtr<GLTransportSurface> m_sharedSurface;
    156156};
  • trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp

    r150958 r166889  
    113113}
    114114
    115 PassOwnPtr<GLPlatformSurface> EGLOffScreenSurface::createOffScreenSurface(SurfaceAttributes attributes)
     115std::unique_ptr<GLPlatformSurface> EGLOffScreenSurface::createOffScreenSurface(SurfaceAttributes attributes)
    116116{
    117     OwnPtr<GLPlatformSurface> surface;
    118117#if PLATFORM(X11)
    119     surface = adoptPtr(new EGLPixmapSurface(attributes));
     118    return std::make_unique<EGLPixmapSurface>(attributes);
    120119#else
    121120    UNUSED_PARAM(attributes);
     121    return nullptr;
    122122#endif
    123 
    124     if (surface)
    125         return surface.release();
    126 
    127     return nullptr;
    128123}
    129124
  • trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h

    r162139 r166889  
    5454class EGLOffScreenSurface : public GLPlatformSurface {
    5555public:
    56     static PassOwnPtr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes);
     56    static std::unique_ptr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes);
    5757    virtual ~EGLOffScreenSurface();
    5858    virtual PlatformSurfaceConfig configuration() override;
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r165341 r166889  
    4646GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(GraphicsLayerClient* client)
    4747    : GraphicsLayer(client)
    48     , m_layer(adoptPtr(new TextureMapperLayer()))
     48    , m_layer(std::make_unique<TextureMapperLayer>())
    4949    , m_compositedNativeImagePtr(0)
    5050    , m_changeMask(NoChanges)
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h

    r165341 r166889  
    161161    void notifyChange(ChangeMask);
    162162
    163     OwnPtr<TextureMapperLayer> m_layer;
     163    std::unique_ptr<TextureMapperLayer> m_layer;
    164164    RefPtr<TextureMapperTiledBackingStore> m_compositedImage;
    165165    NativeImagePtr m_compositedNativeImagePtr;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp

    r166480 r166889  
    129129}
    130130
    131 PassOwnPtr<TextureMapper> TextureMapper::create(AccelerationMode mode)
     131std::unique_ptr<TextureMapper> TextureMapper::create(AccelerationMode mode)
    132132{
    133133    if (mode == SoftwareMode)
    134         return TextureMapperImageBuffer::create();
     134        return std::make_unique<TextureMapperImageBuffer>();
    135135    return platformCreateAccelerated();
    136136}
     
    140140    , m_interpolationQuality(InterpolationDefault)
    141141    , m_textDrawingMode(TextModeFill)
    142     , m_texturePool(adoptPtr(new BitmapTexturePool()))
     142    , m_texturePool(std::make_unique<BitmapTexturePool>())
    143143    , m_accelerationMode(accelerationMode)
    144144    , m_isMaskMode(false)
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h

    r166480 r166889  
    117117    typedef unsigned PaintFlags;
    118118
    119     static PassOwnPtr<TextureMapper> create(AccelerationMode newMode = SoftwareMode);
     119    static std::unique_ptr<TextureMapper> create(AccelerationMode newMode = SoftwareMode);
     120
     121    explicit TextureMapper(AccelerationMode);
    120122    virtual ~TextureMapper();
    121123
     
    164166
    165167protected:
    166     explicit TextureMapper(AccelerationMode);
    167 
    168168    GraphicsContext* m_context;
    169169
     
    174174private:
    175175#if USE(TEXTURE_MAPPER_GL)
    176     static PassOwnPtr<TextureMapper> platformCreateAccelerated();
     176    static std::unique_ptr<TextureMapper> platformCreateAccelerated();
    177177#else
    178     static PassOwnPtr<TextureMapper> platformCreateAccelerated()
     178    static std::unique_ptr<TextureMapper> platformCreateAccelerated()
    179179    {
    180         return PassOwnPtr<TextureMapper>();
     180        return std::make_unique<TextureMapper>();
    181181    }
    182182#endif
    183183    InterpolationQuality m_interpolationQuality;
    184184    TextDrawingModeFlags m_textDrawingMode;
    185     OwnPtr<BitmapTexturePool> m_texturePool;
     185    std::unique_ptr<BitmapTexturePool> m_texturePool;
    186186    AccelerationMode m_accelerationMode;
    187187    bool m_isMaskMode;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

    r164825 r166889  
    11301130
    11311131#if USE(TEXTURE_MAPPER_GL)
    1132 PassOwnPtr<TextureMapper> TextureMapper::platformCreateAccelerated()
    1133 {
    1134     return TextureMapperGL::create();
     1132std::unique_ptr<TextureMapper> TextureMapper::platformCreateAccelerated()
     1133{
     1134    return std::make_unique<TextureMapperGL>();
    11351135}
    11361136#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h

    r163079 r166889  
    3939class TextureMapperGL : public TextureMapper {
    4040public:
    41     static PassOwnPtr<TextureMapperGL> create() { return adoptPtr(new TextureMapperGL); }
     41    TextureMapperGL();
    4242    virtual ~TextureMapperGL();
    4343
     
    121121    };
    122122
    123     TextureMapperGL();
    124 
    125123    void drawTexturedQuadWithProgram(TextureMapperShaderProgram*, uint32_t texture, Flags, const IntSize&, const FloatRect&, const TransformationMatrix& modelViewMatrix, float opacity);
    126124    void draw(const FloatRect&, const TransformationMatrix& modelViewMatrix, TextureMapperShaderProgram*, GC3Denum drawingMode, Flags);
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h

    r162139 r166889  
    5151    WTF_MAKE_FAST_ALLOCATED;
    5252public:
    53     static PassOwnPtr<TextureMapper> create() { return adoptPtr(new TextureMapperImageBuffer); }
     53    TextureMapperImageBuffer()
     54        : TextureMapper(SoftwareMode)
     55    { }
    5456
    5557    // TextureMapper implementation
     
    7173
    7274private:
    73     TextureMapperImageBuffer()
    74         : TextureMapper(SoftwareMode)
    75     { }
    7675    RefPtr<BitmapTexture> m_currentSurface;
    7776};
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp

    r166566 r166889  
    647647    m_layers.clear();
    648648    m_fixedLayers.clear();
    649     m_textureMapper.clear();
     649    m_textureMapper = nullptr;
    650650    m_backingStores.clear();
    651651    m_backingStoresWithPendingBuffers.clear();
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h

    r166566 r166889  
    153153    Mutex m_renderQueueMutex;
    154154
    155     OwnPtr<TextureMapper> m_textureMapper;
     155    std::unique_ptr<TextureMapper> m_textureMapper;
    156156
    157157    typedef HashMap<CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore> > ImageBackingMap;
  • trunk/Source/WebCore/platform/graphics/transforms/TransformState.cpp

    r165676 r166889  
    2727#include "TransformState.h"
    2828
    29 #include <wtf/PassOwnPtr.h>
    30 
    3129namespace WebCore {
    3230
     
    4341    m_direction = other.m_direction;
    4442   
    45     m_accumulatedTransform.clear();
     43    m_accumulatedTransform = nullptr;
    4644
    4745    if (other.m_accumulatedTransform)
    48         m_accumulatedTransform = adoptPtr(new TransformationMatrix(*other.m_accumulatedTransform));
     46        m_accumulatedTransform = std::make_unique<TransformationMatrix>(*other.m_accumulatedTransform);
    4947       
    5048    return *this;
     
    122120    if (m_accumulatedTransform) {
    123121        if (m_direction == ApplyTransformDirection)
    124             m_accumulatedTransform = adoptPtr(new TransformationMatrix(transformFromContainer * *m_accumulatedTransform));
     122            m_accumulatedTransform = std::make_unique<TransformationMatrix>(transformFromContainer * *m_accumulatedTransform);
    125123        else
    126124            m_accumulatedTransform->multiply(transformFromContainer);
    127125    } else if (accumulate == AccumulateTransform) {
    128126        // Make one if we started to accumulate
    129         m_accumulatedTransform = adoptPtr(new TransformationMatrix(transformFromContainer));
     127        m_accumulatedTransform = std::make_unique<TransformationMatrix>(transformFromContainer);
    130128    }
    131129   
  • trunk/Source/WebCore/platform/graphics/transforms/TransformState.h

    r165676 r166889  
    3333#include "LayoutSize.h"
    3434#include "TransformationMatrix.h"
    35 #include <wtf/OwnPtr.h>
    3635
    3736namespace WebCore {
     
    111110
    112111    // We only allocate the transform if we need to
    113     OwnPtr<TransformationMatrix> m_accumulatedTransform;
     112    std::unique_ptr<TransformationMatrix> m_accumulatedTransform;
    114113    LayoutSize m_accumulatedOffset;
    115114    bool m_accumulatingTransform;
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp

    r163079 r166889  
    8080    , m_multisampleDepthStencilBuffer(0)
    8181    , m_multisampleColorBuffer(0)
    82     , m_private(GraphicsContext3DPrivate::create(this, renderStyle))
     82    , m_private(std::make_unique<GraphicsContext3DPrivate>(this, renderStyle))
    8383{
    8484    makeContextCurrent();
     
    164164}
    165165
    166 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
    167 {
    168 }
    169 
    170 void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
     166void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>)
     167{
     168}
     169
     170void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>)
    171171{
    172172}
  • trunk/Source/WebKit/efl/ChangeLog

    r166866 r166889  
     12014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
     2
     3        Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
     4        https://bugs.webkit.org/show_bug.cgi?id=131276
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace uses of OwnPtr for TextureMapper in AcceleratedCompositingContextEfl with std::unique_ptr.
     9
     10        * WebCoreSupport/AcceleratedCompositingContextEfl.h:
     11
    1122014-04-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    213
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h

    r166768 r166889  
    2727#include "Timer.h"
    2828#include <wtf/Noncopyable.h>
    29 #include <wtf/OwnPtr.h>
    3029#include <wtf/efl/UniquePtrEfl.h>
    3130
     
    5857    Evas_Object* m_compositingObject;
    5958
    60     OwnPtr<TextureMapper> m_textureMapper;
     59    std::unique_ptr<TextureMapper> m_textureMapper;
    6160    GraphicsLayer* m_rootLayer;
    6261    Timer<AcceleratedCompositingContext> m_syncTimer;
  • trunk/Source/WebKit/gtk/ChangeLog

    r166661 r166889  
     12014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
     2
     3        Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
     4        https://bugs.webkit.org/show_bug.cgi?id=131276
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace uses of OwnPtr for TextureMapper in AcceleratedCompositingContext with std::unique_ptr.
     9
     10        * WebCoreSupport/AcceleratedCompositingContext.h:
     11
    1122014-04-02  Martin Hock  <mhock@apple.com>
    213
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h

    r165253 r166889  
    7676    std::unique_ptr<WebCore::GraphicsLayer> m_rootLayer;
    7777    std::unique_ptr<WebCore::GraphicsLayer> m_nonCompositedContentLayer;
    78     OwnPtr<WebCore::TextureMapper> m_textureMapper;
     78    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
    7979    double m_lastFlushTime;
    8080    double m_redrawPendingTime;
  • trunk/Source/WebKit2/ChangeLog

    r166888 r166889  
     12014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
     2
     3        Move to using std::unique_ptr for opengl, texmap, transforms and efl in WebCore/platform/graphics.
     4        https://bugs.webkit.org/show_bug.cgi?id=131276
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace uses of OwnPtr for TextureMapper in LayerTreeHostGtk with std::unique_ptr.
     9
     10        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
     11
    1122014-04-07  Joseph Pecoraro  <pecoraro@apple.com>
    213
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h

    r163931 r166889  
    104104    typedef HashMap<PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> PageOverlayLayerMap;
    105105    PageOverlayLayerMap m_pageOverlayLayers;
    106     OwnPtr<WebCore::TextureMapper> m_textureMapper;
     106    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
    107107    OwnPtr<WebCore::GLContext> m_context;
    108108    double m_lastFlushTime;
Note: See TracChangeset for help on using the changeset viewer.