Changeset 166889 in webkit
- Timestamp:
- Apr 7, 2014 3:21:58 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166886 r166889 1 2014-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 1 75 2014-04-07 Tim Horton <timothy_horton@apple.com> 2 76 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r166803 r166889 589 589 m_context->scissor(0, 0, canvasSize.width(), canvasSize.height()); 590 590 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)); 593 593 } 594 594 -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r166803 r166889 478 478 }; 479 479 480 void setContextLostCallback( PassOwnPtr<ContextLostCallback>);481 void setErrorMessageCallback( PassOwnPtr<ErrorMessageCallback>);480 void setContextLostCallback(std::unique_ptr<ContextLostCallback>); 481 void setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>); 482 482 483 483 static PassRefPtr<GraphicsContext3D> create(Attributes, HostWindow*, RenderStyle = RenderOffscreen); … … 1144 1144 1145 1145 friend class GraphicsContext3DPrivate; 1146 OwnPtr<GraphicsContext3DPrivate> m_private;1146 std::unique_ptr<GraphicsContext3DPrivate> m_private; 1147 1147 }; 1148 1148 -
trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
r163079 r166889 45 45 46 46 namespace WebCore { 47 48 PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle)49 {50 return adoptPtr(new GraphicsContext3DPrivate(context, renderStyle));51 }52 47 53 48 GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle) -
trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h
r163079 r166889 37 37 { 38 38 public: 39 static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, GraphicsContext3D::RenderStyle);39 GraphicsContext3DPrivate(GraphicsContext3D*, GraphicsContext3D::RenderStyle); 40 40 ~GraphicsContext3DPrivate(); 41 41 bool makeContextCurrent(); … … 49 49 50 50 private: 51 GraphicsContext3DPrivate(GraphicsContext3D*, GraphicsContext3D::RenderStyle);52 53 51 GraphicsContext3D* m_context; 54 52 OwnPtr<GLContext> m_glContext; -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
r165676 r166889 39 39 #include "RefPtrCairo.h" 40 40 #include <cairo.h> 41 #include <wtf/OwnPtr.h>42 #include <wtf/PassOwnPtr.h>43 41 44 42 #if PLATFORM(WIN) … … 90 88 , m_multisampleDepthStencilBuffer(0) 91 89 , m_multisampleColorBuffer(0) 92 , m_private( GraphicsContext3DPrivate::create(this, renderStyle))90 , m_private(std::make_unique<GraphicsContext3DPrivate>(this, renderStyle)) 93 91 { 94 92 makeContextCurrent(); … … 273 271 } 274 272 275 void GraphicsContext3D::setContextLostCallback( PassOwnPtr<ContextLostCallback>)276 { 277 } 278 279 void GraphicsContext3D::setErrorMessageCallback( PassOwnPtr<ErrorMessageCallback>)273 void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>) 274 { 275 } 276 277 void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>) 280 278 { 281 279 } -
trunk/Source/WebCore/platform/graphics/efl/EvasGLContext.h
r166039 r166889 28 28 29 29 #include <Evas_GL.h> 30 #include <wtf/PassOwnPtr.h>31 30 32 31 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/efl/EvasGLSurface.h
r166039 r166889 30 30 31 31 #include <Evas_GL.h> 32 #include <wtf/PassOwnPtr.h>33 32 34 33 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
r163079 r166889 198 198 } 199 199 200 void GraphicsContext3D::setContextLostCallback( PassOwnPtr<ContextLostCallback> callBack)201 { 202 m_private->setContextLostCallback( callBack);203 } 204 205 void GraphicsContext3D::setErrorMessageCallback( PassOwnPtr<ErrorMessageCallback>)200 void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback> callBack) 201 { 202 m_private->setContextLostCallback(std::move(callBack)); 203 } 204 205 void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>) 206 206 { 207 207 notImplemented(); -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
r163761 r166889 27 27 namespace WebCore { 28 28 29 PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, HostWindow* hostWindow)30 { 31 OwnPtr<GraphicsContext3DPrivate> platformLayer = adoptPtr(new GraphicsContext3DPrivate(context, hostWindow));29 std::unique_ptr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, HostWindow* hostWindow) 30 { 31 std::unique_ptr<GraphicsContext3DPrivate> platformLayer = std::make_unique<GraphicsContext3DPrivate>(context, hostWindow); 32 32 33 33 if (platformLayer && platformLayer->initialize()) 34 return platformLayer .release();34 return platformLayer; 35 35 36 36 return nullptr; … … 106 106 } 107 107 108 void GraphicsContext3DPrivate::setContextLostCallback( PassOwnPtr<GraphicsContext3D::ContextLostCallback> callBack)109 { 110 m_contextLostCallback = callBack;108 void GraphicsContext3DPrivate::setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback> callBack) 109 { 110 m_contextLostCallback = std::move(callBack); 111 111 } 112 112 -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h
r163761 r166889 29 29 30 30 #include "GLPlatformContext.h" 31 #include <wtf/PassOwnPtr.h>32 31 33 32 namespace WebCore { … … 38 37 { 39 38 public: 40 static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, HostWindow*); 39 static std::unique_ptr<GraphicsContext3DPrivate> create(GraphicsContext3D*, HostWindow*); 40 41 GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*); 41 42 ~GraphicsContext3DPrivate(); 42 43 43 44 PlatformGraphicsContext3D platformGraphicsContext3D() const; 44 void setContextLostCallback( PassOwnPtr<GraphicsContext3D::ContextLostCallback>);45 void setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>); 45 46 #if USE(TEXTURE_MAPPER_GL) 46 47 virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override; … … 67 68 #endif 68 69 69 GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*);70 70 bool initialize(); 71 71 void createGraphicsSurface(); … … 75 75 GraphicsContext3D* m_context; 76 76 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; 79 79 #if USE(GRAPHICS_SURFACE) 80 80 GraphicsSurfaceToken m_surfaceHandle; … … 83 83 PendingSurfaceOperation m_surfaceOperation : 3; 84 84 #endif 85 OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;85 std::unique_ptr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback; 86 86 ListHashSet<GC3Denum> m_syntheticErrors; 87 87 IntSize m_size; -
trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
r165865 r166889 133 133 , m_multisampleDepthStencilBuffer(0) 134 134 , m_multisampleColorBuffer(0) 135 , m_private( adoptPtr(new GraphicsContext3DPrivate(this)))135 , m_private(std::make_unique<GraphicsContext3DPrivate>(this)) 136 136 { 137 137 UNUSED_PARAM(hostWindow); … … 364 364 } 365 365 366 void GraphicsContext3D::setContextLostCallback( PassOwnPtr<ContextLostCallback>)367 { 368 } 369 370 void GraphicsContext3D::setErrorMessageCallback( PassOwnPtr<ErrorMessageCallback>)366 void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>) 367 { 368 } 369 370 void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>) 371 371 { 372 372 } -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
r165688 r166889 186 186 } 187 187 188 void Extensions3DOpenGLES::setEXTContextLostCallback( PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)189 { 190 m_contextLostCallback = callback;188 void Extensions3DOpenGLES::setEXTContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback> callback) 189 { 190 m_contextLostCallback = std::move(callback); 191 191 } 192 192 -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
r164468 r166889 86 86 // EXT Robustness - reset 87 87 virtual int getGraphicsResetStatusARB(); 88 void setEXTContextLostCallback( PassOwnPtr<GraphicsContext3D::ContextLostCallback>);88 void setEXTContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>); 89 89 90 90 // EXT Robustness - etc … … 121 121 PFNGLDRAWELEMENTSINSTANCEDANGLEPROC m_glDrawElementsInstancedANGLE; 122 122 123 124 OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback; 123 std::unique_ptr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback; 125 124 }; 126 125 -
trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp
r163079 r166889 62 62 }; 63 63 64 static PassOwnPtr<GLPlatformContext> createOffScreenContext()65 { 66 #if USE(GLX) 67 return adoptPtr(new GLXOffScreenContext());68 #elif USE(EGL) 69 return adoptPtr(new EGLOffScreenContext());64 static 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>(); 70 70 #else 71 71 return nullptr; … … 101 101 } 102 102 103 PassOwnPtr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D::RenderStyle renderStyle)103 std::unique_ptr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D::RenderStyle renderStyle) 104 104 { 105 105 #if !USE(OPENGL_ES_2) … … 110 110 switch (renderStyle) { 111 111 case GraphicsContext3D::RenderOffscreen: 112 if (OwnPtr<GLPlatformContext> context = createOffScreenContext()) 113 return context.release(); 114 break; 112 return createOffScreenContext(); 115 113 case GraphicsContext3D::RenderToCurrentGLContext: 116 if (OwnPtr<GLPlatformContext> context = adoptPtr(new GLCurrentContextWrapper())) 117 return context.release(); 118 break; 114 return std::make_unique<GLCurrentContextWrapper>(); 119 115 case GraphicsContext3D::RenderDirectlyToHostWindow: 120 116 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/platform/graphics/opengl/GLPlatformContext.h
r163079 r166889 31 31 #include "GraphicsContext3D.h" 32 32 #include <wtf/Noncopyable.h> 33 #include <wtf/PassOwnPtr.h>34 33 35 34 // Encapsulates an OpenGL context, hiding platform specific management. … … 48 47 }; 49 48 50 static PassOwnPtr<GLPlatformContext> createContext(GraphicsContext3D::RenderStyle);49 static std::unique_ptr<GLPlatformContext> createContext(GraphicsContext3D::RenderStyle); 51 50 52 51 static bool supportsGLExtension(const String&); -
trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp
r163079 r166889 41 41 static GLPlatformSurface* m_currentDrawable = 0; 42 42 43 PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes)43 std::unique_ptr<GLPlatformSurface> GLPlatformSurface::createOffScreenSurface(SurfaceAttributes attributes) 44 44 { 45 OwnPtr<GLPlatformSurface> surface;45 std::unique_ptr<GLPlatformSurface> surface; 46 46 #if USE(GLX) 47 surface = adoptPtr(new GLXOffScreenSurface(attributes));47 surface = std::make_unique<GLXOffScreenSurface>(attributes); 48 48 #elif USE(EGL) && USE(GRAPHICS_SURFACE) 49 49 surface = EGLOffScreenSurface::createOffScreenSurface(attributes); … … 54 54 55 55 if (surface && surface->drawable()) 56 return surface .release();56 return surface; 57 57 58 58 return nullptr; -
trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h
r163079 r166889 47 47 typedef unsigned SurfaceAttributes; 48 48 // 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); 50 50 51 51 virtual ~GLPlatformSurface(); -
trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp
r156700 r166889 152 152 PlatformBufferHandle m_sharedHandle; 153 153 OwnPtr<GLTransportSurfaceClient> m_client; 154 OwnPtr<GLPlatformContext> m_sharedContext;154 std::unique_ptr<GLPlatformContext> m_sharedContext; 155 155 OwnPtr<GLTransportSurface> m_sharedSurface; 156 156 }; -
trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp
r150958 r166889 113 113 } 114 114 115 PassOwnPtr<GLPlatformSurface> EGLOffScreenSurface::createOffScreenSurface(SurfaceAttributes attributes)115 std::unique_ptr<GLPlatformSurface> EGLOffScreenSurface::createOffScreenSurface(SurfaceAttributes attributes) 116 116 { 117 OwnPtr<GLPlatformSurface> surface;118 117 #if PLATFORM(X11) 119 surface = adoptPtr(new EGLPixmapSurface(attributes));118 return std::make_unique<EGLPixmapSurface>(attributes); 120 119 #else 121 120 UNUSED_PARAM(attributes); 121 return nullptr; 122 122 #endif 123 124 if (surface)125 return surface.release();126 127 return nullptr;128 123 } 129 124 -
trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h
r162139 r166889 54 54 class EGLOffScreenSurface : public GLPlatformSurface { 55 55 public: 56 static PassOwnPtr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes);56 static std::unique_ptr<GLPlatformSurface> createOffScreenSurface(SurfaceAttributes); 57 57 virtual ~EGLOffScreenSurface(); 58 58 virtual PlatformSurfaceConfig configuration() override; -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r165341 r166889 46 46 GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(GraphicsLayerClient* client) 47 47 : GraphicsLayer(client) 48 , m_layer( adoptPtr(new TextureMapperLayer()))48 , m_layer(std::make_unique<TextureMapperLayer>()) 49 49 , m_compositedNativeImagePtr(0) 50 50 , m_changeMask(NoChanges) -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r165341 r166889 161 161 void notifyChange(ChangeMask); 162 162 163 OwnPtr<TextureMapperLayer> m_layer;163 std::unique_ptr<TextureMapperLayer> m_layer; 164 164 RefPtr<TextureMapperTiledBackingStore> m_compositedImage; 165 165 NativeImagePtr m_compositedNativeImagePtr; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
r166480 r166889 129 129 } 130 130 131 PassOwnPtr<TextureMapper> TextureMapper::create(AccelerationMode mode)131 std::unique_ptr<TextureMapper> TextureMapper::create(AccelerationMode mode) 132 132 { 133 133 if (mode == SoftwareMode) 134 return TextureMapperImageBuffer::create();134 return std::make_unique<TextureMapperImageBuffer>(); 135 135 return platformCreateAccelerated(); 136 136 } … … 140 140 , m_interpolationQuality(InterpolationDefault) 141 141 , m_textDrawingMode(TextModeFill) 142 , m_texturePool( adoptPtr(new BitmapTexturePool()))142 , m_texturePool(std::make_unique<BitmapTexturePool>()) 143 143 , m_accelerationMode(accelerationMode) 144 144 , m_isMaskMode(false) -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r166480 r166889 117 117 typedef unsigned PaintFlags; 118 118 119 static PassOwnPtr<TextureMapper> create(AccelerationMode newMode = SoftwareMode); 119 static std::unique_ptr<TextureMapper> create(AccelerationMode newMode = SoftwareMode); 120 121 explicit TextureMapper(AccelerationMode); 120 122 virtual ~TextureMapper(); 121 123 … … 164 166 165 167 protected: 166 explicit TextureMapper(AccelerationMode);167 168 168 GraphicsContext* m_context; 169 169 … … 174 174 private: 175 175 #if USE(TEXTURE_MAPPER_GL) 176 static PassOwnPtr<TextureMapper> platformCreateAccelerated();176 static std::unique_ptr<TextureMapper> platformCreateAccelerated(); 177 177 #else 178 static PassOwnPtr<TextureMapper> platformCreateAccelerated()178 static std::unique_ptr<TextureMapper> platformCreateAccelerated() 179 179 { 180 return PassOwnPtr<TextureMapper>();180 return std::make_unique<TextureMapper>(); 181 181 } 182 182 #endif 183 183 InterpolationQuality m_interpolationQuality; 184 184 TextDrawingModeFlags m_textDrawingMode; 185 OwnPtr<BitmapTexturePool> m_texturePool;185 std::unique_ptr<BitmapTexturePool> m_texturePool; 186 186 AccelerationMode m_accelerationMode; 187 187 bool m_isMaskMode; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r164825 r166889 1130 1130 1131 1131 #if USE(TEXTURE_MAPPER_GL) 1132 PassOwnPtr<TextureMapper> TextureMapper::platformCreateAccelerated()1133 { 1134 return TextureMapperGL::create();1132 std::unique_ptr<TextureMapper> TextureMapper::platformCreateAccelerated() 1133 { 1134 return std::make_unique<TextureMapperGL>(); 1135 1135 } 1136 1136 #endif -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r163079 r166889 39 39 class TextureMapperGL : public TextureMapper { 40 40 public: 41 static PassOwnPtr<TextureMapperGL> create() { return adoptPtr(new TextureMapperGL); }41 TextureMapperGL(); 42 42 virtual ~TextureMapperGL(); 43 43 … … 121 121 }; 122 122 123 TextureMapperGL();124 125 123 void drawTexturedQuadWithProgram(TextureMapperShaderProgram*, uint32_t texture, Flags, const IntSize&, const FloatRect&, const TransformationMatrix& modelViewMatrix, float opacity); 126 124 void draw(const FloatRect&, const TransformationMatrix& modelViewMatrix, TextureMapperShaderProgram*, GC3Denum drawingMode, Flags); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
r162139 r166889 51 51 WTF_MAKE_FAST_ALLOCATED; 52 52 public: 53 static PassOwnPtr<TextureMapper> create() { return adoptPtr(new TextureMapperImageBuffer); } 53 TextureMapperImageBuffer() 54 : TextureMapper(SoftwareMode) 55 { } 54 56 55 57 // TextureMapper implementation … … 71 73 72 74 private: 73 TextureMapperImageBuffer()74 : TextureMapper(SoftwareMode)75 { }76 75 RefPtr<BitmapTexture> m_currentSurface; 77 76 }; -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
r166566 r166889 647 647 m_layers.clear(); 648 648 m_fixedLayers.clear(); 649 m_textureMapper .clear();649 m_textureMapper = nullptr; 650 650 m_backingStores.clear(); 651 651 m_backingStoresWithPendingBuffers.clear(); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h
r166566 r166889 153 153 Mutex m_renderQueueMutex; 154 154 155 OwnPtr<TextureMapper> m_textureMapper;155 std::unique_ptr<TextureMapper> m_textureMapper; 156 156 157 157 typedef HashMap<CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore> > ImageBackingMap; -
trunk/Source/WebCore/platform/graphics/transforms/TransformState.cpp
r165676 r166889 27 27 #include "TransformState.h" 28 28 29 #include <wtf/PassOwnPtr.h>30 31 29 namespace WebCore { 32 30 … … 43 41 m_direction = other.m_direction; 44 42 45 m_accumulatedTransform .clear();43 m_accumulatedTransform = nullptr; 46 44 47 45 if (other.m_accumulatedTransform) 48 m_accumulatedTransform = adoptPtr(new TransformationMatrix(*other.m_accumulatedTransform));46 m_accumulatedTransform = std::make_unique<TransformationMatrix>(*other.m_accumulatedTransform); 49 47 50 48 return *this; … … 122 120 if (m_accumulatedTransform) { 123 121 if (m_direction == ApplyTransformDirection) 124 m_accumulatedTransform = adoptPtr(new TransformationMatrix(transformFromContainer * *m_accumulatedTransform));122 m_accumulatedTransform = std::make_unique<TransformationMatrix>(transformFromContainer * *m_accumulatedTransform); 125 123 else 126 124 m_accumulatedTransform->multiply(transformFromContainer); 127 125 } else if (accumulate == AccumulateTransform) { 128 126 // Make one if we started to accumulate 129 m_accumulatedTransform = adoptPtr(new TransformationMatrix(transformFromContainer));127 m_accumulatedTransform = std::make_unique<TransformationMatrix>(transformFromContainer); 130 128 } 131 129 -
trunk/Source/WebCore/platform/graphics/transforms/TransformState.h
r165676 r166889 33 33 #include "LayoutSize.h" 34 34 #include "TransformationMatrix.h" 35 #include <wtf/OwnPtr.h>36 35 37 36 namespace WebCore { … … 111 110 112 111 // We only allocate the transform if we need to 113 OwnPtr<TransformationMatrix> m_accumulatedTransform;112 std::unique_ptr<TransformationMatrix> m_accumulatedTransform; 114 113 LayoutSize m_accumulatedOffset; 115 114 bool m_accumulatingTransform; -
trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp
r163079 r166889 80 80 , m_multisampleDepthStencilBuffer(0) 81 81 , m_multisampleColorBuffer(0) 82 , m_private( GraphicsContext3DPrivate::create(this, renderStyle))82 , m_private(std::make_unique<GraphicsContext3DPrivate>(this, renderStyle)) 83 83 { 84 84 makeContextCurrent(); … … 164 164 } 165 165 166 void GraphicsContext3D::setContextLostCallback( PassOwnPtr<ContextLostCallback>)167 { 168 } 169 170 void GraphicsContext3D::setErrorMessageCallback( PassOwnPtr<ErrorMessageCallback>)166 void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>) 167 { 168 } 169 170 void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr<ErrorMessageCallback>) 171 171 { 172 172 } -
trunk/Source/WebKit/efl/ChangeLog
r166866 r166889 1 2014-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 1 12 2014-04-06 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 13 -
trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h
r166768 r166889 27 27 #include "Timer.h" 28 28 #include <wtf/Noncopyable.h> 29 #include <wtf/OwnPtr.h>30 29 #include <wtf/efl/UniquePtrEfl.h> 31 30 … … 58 57 Evas_Object* m_compositingObject; 59 58 60 OwnPtr<TextureMapper> m_textureMapper;59 std::unique_ptr<TextureMapper> m_textureMapper; 61 60 GraphicsLayer* m_rootLayer; 62 61 Timer<AcceleratedCompositingContext> m_syncTimer; -
trunk/Source/WebKit/gtk/ChangeLog
r166661 r166889 1 2014-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 1 12 2014-04-02 Martin Hock <mhock@apple.com> 2 13 -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h
r165253 r166889 76 76 std::unique_ptr<WebCore::GraphicsLayer> m_rootLayer; 77 77 std::unique_ptr<WebCore::GraphicsLayer> m_nonCompositedContentLayer; 78 OwnPtr<WebCore::TextureMapper> m_textureMapper;78 std::unique_ptr<WebCore::TextureMapper> m_textureMapper; 79 79 double m_lastFlushTime; 80 80 double m_redrawPendingTime; -
trunk/Source/WebKit2/ChangeLog
r166888 r166889 1 2014-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 1 12 2014-04-07 Joseph Pecoraro <pecoraro@apple.com> 2 13 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
r163931 r166889 104 104 typedef HashMap<PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> PageOverlayLayerMap; 105 105 PageOverlayLayerMap m_pageOverlayLayers; 106 OwnPtr<WebCore::TextureMapper> m_textureMapper;106 std::unique_ptr<WebCore::TextureMapper> m_textureMapper; 107 107 OwnPtr<WebCore::GLContext> m_context; 108 108 double m_lastFlushTime;
Note: See TracChangeset
for help on using the changeset viewer.