2 Copyright (C) 2013 Intel Corporation. All rights reserved.
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.
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.
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.
22 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE) && ENABLE(TIZEN_ACCELERATED_PLATFORM_LAYER)
24 #include "PlatformTextureWayland.h"
27 PlatformTextureWayland::PlatformTextureWayland(int platformSurfaceID, const IntSize& size)
29 , m_platformSurfaceID(platformSurfaceID)
35 PlatformTextureWayland::~PlatformTextureWayland()
39 WaylandDisplay* display = WaylandDisplay::instance();
41 display->unMapBuffer(m_platformSurfaceID, this);
45 bool PlatformTextureWayland::initialize(bool useLinearFilter)
50 if (!m_platformSurfaceID) {
51 LOG_ERROR("ID is invalid!");
56 WaylandDisplay* display = WaylandDisplay::instance();
58 LOG_ERROR("WaylandDisplay not initialized");
62 m_buffer = display->mapBuffer(m_platformSurfaceID, this, useLinearFilter);
64 LOG_ERROR("Failed to map buffer for the surface");
72 uint32_t PlatformTextureWayland::id() const
74 return m_buffer ? m_buffer->textureId() :0;
77 void PlatformTextureWayland::bufferDestroyed()
80 m_platformSurfaceID = 0;