| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | |
| 3 | |
| 4 This library is free software; you can redistribute it and/or | |
| 5 modify it under the terms of the GNU Library General Public | |
| 6 License as published by the Free Software Foundation; either | |
| 7 version 2 of the License, or (at your option) any later version. | |
| 8 | |
| 9 This library is distributed in the hope that it will be useful, | |
| 10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 Library General Public License for more details. | |
| 13 | |
| 14 You should have received a copy of the GNU Library General Public License | |
| 15 along with this library; see the file COPYING.LIB. If not, write to | |
| 16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
| 17 Boston, MA 02110-1301, USA. | |
| 18 */ | |
| 19 | |
| 20 #include "config.h" | |
| 21 #include "GraphicsSurface.h" | |
| 22 | |
| 23 #include "NotImplemented.h" | |
| 24 | |
| 25 #if USE(GRAPHICS_SURFACE) | |
| 26 namespace WebCore { | |
| 27 | |
| 28 PassRefPtr<GraphicsSurface> GraphicsSurface::create(const IntSize& size, Flags f
lags, const GraphicsSurfaceToken& token) | |
| 29 { | |
| 30 return platformImport(size, flags, token); | |
| 31 } | |
| 32 | |
| 33 PassRefPtr<GraphicsSurface> GraphicsSurface::create(const IntSize& size, Graphic
sSurface::Flags flags, const PlatformGraphicsContext3D shareContext) | |
| 34 { | |
| 35 return platformCreate(size, flags, shareContext); | |
| 36 } | |
| 37 | |
| 38 GraphicsSurfaceToken GraphicsSurface::exportToken() | |
| 39 { | |
| 40 return platformExport(); | |
| 41 } | |
| 42 | |
| 43 uint32_t GraphicsSurface::getTextureID() | |
| 44 { | |
| 45 return platformGetTextureID(); | |
| 46 } | |
| 47 | |
| 48 PassOwnPtr<GraphicsContext> GraphicsSurface::beginPaint(const IntRect& rect, Loc
kOptions lockOptions) | |
| 49 { | |
| 50 int stride = 0; | |
| 51 char* bits = platformLock(rect, &stride, lockOptions); | |
| 52 OwnPtr<GraphicsContext> graphicsContext = platformBeginPaint(rect.size(), bi
ts, stride); | |
| 53 return graphicsContext.release(); | |
| 54 } | |
| 55 | |
| 56 void GraphicsSurface::copyToGLTexture(uint32_t target, uint32_t texture, const I
ntRect& targetRect, const IntPoint& offset) | |
| 57 { | |
| 58 platformCopyToGLTexture(target, texture, targetRect, offset); | |
| 59 } | |
| 60 | |
| 61 void GraphicsSurface::copyFromTexture(uint32_t texture, const IntRect& sourceRec
t) | |
| 62 { | |
| 63 platformCopyFromTexture(texture, sourceRect); | |
| 64 } | |
| 65 | |
| 66 void GraphicsSurface::paintToTextureMapper(TextureMapper* textureMapper, const F
loatRect& targetRect, const TransformationMatrix& transform, float opacity) | |
| 67 { | |
| 68 platformPaintToTextureMapper(textureMapper, targetRect, transform, opacity); | |
| 69 } | |
| 70 | |
| 71 uint32_t GraphicsSurface::frontBuffer() | |
| 72 { | |
| 73 return platformFrontBuffer(); | |
| 74 } | |
| 75 | |
| 76 uint32_t GraphicsSurface::swapBuffers() | |
| 77 { | |
| 78 return platformSwapBuffers(); | |
| 79 } | |
| 80 | |
| 81 IntSize GraphicsSurface::size() const | |
| 82 { | |
| 83 return platformSize(); | |
| 84 } | |
| 85 | |
| 86 GraphicsSurface::GraphicsSurface(const IntSize&, Flags flags) | |
| 87 : m_flags(flags) | |
| 88 , m_fbo(0) | |
| 89 , m_private(0) | |
| 90 { | |
| 91 } | |
| 92 | |
| 93 GraphicsSurface::~GraphicsSurface() | |
| 94 { | |
| 95 platformDestroy(); | |
| 96 } | |
| 97 | |
| 98 } | |
| 99 #endif | |
| OLD | NEW |