Enable Canvas2D based on Cairo GLES.
[platform/framework/web/webkit-efl.git] / Source / WebCore / platform / graphics / ImageBuffer.h
index 8add808..d8da7d6 100644 (file)
@@ -22,7 +22,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef ImageBuffer_h
@@ -31,6 +31,9 @@
 #include "AffineTransform.h"
 #include "ColorSpace.h"
 #include "FloatRect.h"
+#if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING) || ENABLE(TIZEN_CANVAS_SURFACE_LOCKING)
+#include "GLPlatformSurface.h"
+#endif
 #include "GraphicsContext.h"
 #if USE(ACCELERATED_COMPOSITING)
 #include "PlatformLayer.h"
@@ -67,7 +70,6 @@ namespace WebCore {
         , AcceleratedMemorySaving
 #endif
     };
-    
     enum BackingStoreCopy {
         CopyBackingStore, // Guarantee subsequent draws don't affect the copy.
         DontCopyBackingStore // Subsequent draws may affect the copy.
@@ -111,9 +113,7 @@ namespace WebCore {
         PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
 
         void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
-        
         void convertToLuminanceMask();
-        
         String toDataURL(const String& mimeType, const double* quality = 0, CoordinateSystem = LogicalCoordinateSystem) const;
 #if !USE(CG)
         AffineTransform baseTransform() const { return AffineTransform(); }
@@ -128,7 +128,7 @@ namespace WebCore {
 
         bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, bool, bool);
 #if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING) || ENABLE(TIZEN_CANVAS_SURFACE_LOCKING)
-        int getPlatformSurfaceID() const { return m_platformSurfaceID; }
+        PlatformBufferHandle getPlatformSurfaceID() const { return m_offScreenSurface->handle(); }
         bool isLockable() const { return m_isLockable; }
         void swapPlatformSurfaces();
 #endif
@@ -160,22 +160,14 @@ namespace WebCore {
         // so that create() knows when it should return failure.
         ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, RenderingMode, DeferralMode, bool& success);
 
-#if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING)
-        bool setBindingTexture();
-
-        unsigned m_bindingTexID;
-        void* m_eglImage;
-#endif // ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING)
-
 #if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING) || ENABLE(TIZEN_CANVAS_SURFACE_LOCKING)
         void initializeEGL();
+        void destroy();
         bool lockSurface() const;
         PassRefPtr<cairo_surface_t> querySurface() const;
         bool unlockSurface() const;
-
-        int m_platformSurfaceID;
-        void* m_eglSurface;
         bool m_isLockable;
+        OwnPtr<GLPlatformSurface> m_offScreenSurface;
 #endif // ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING) || ENABLE(TIZEN_CANVAS_SURFACE_LOCKING)
 
     };